Sponsored Content
Full Discussion: [Solved] Help with condition
Top Forums Shell Programming and Scripting [Solved] Help with condition Post 302885409 by MadeInGermany on Sunday 26th of January 2014 02:14:45 AM
Old 01-26-2014
With the [ ] trick grep does not find its own args
Code:
count=$(ps -ef | grep -c "[p]pp.sh")

A perhaps more precise match is
Code:
count=$(ps -ef | grep -wc "[p]pp\.sh")


Last edited by MadeInGermany; 01-26-2014 at 03:21 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if condition ...

i have following if condition if above statement is case sensitive.....what is syntax if i have to make above comparision case insensetive (4 Replies)
Discussion started by: mahabunta
4 Replies

2. Shell Programming and Scripting

if condition

Hi how to write this: if then usage fi thx (3 Replies)
Discussion started by: melanie_pfefer
3 Replies

3. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

4. HP-UX

Difference between [condition] and [[condition]] and ((condition)) when used with if condition

Executed the following if conditions .. and got different results . only (( )) gave correct o/p with all scenarios . Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition. And why each condition gave different result. 1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies

5. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Delete files with condition

I have a directory containing thousands of items “video files”, these items were generated by an application, which generates two items with the same name but with different extensions “.avi and .mp4”. There was a tool in my application to remove one item @ a time. Later I found this tool removes... (5 Replies)
Discussion started by: awadeid
5 Replies

7. Shell Programming and Scripting

[SOLVED] Sorting file and get everything on same line on condition

Good afternoon! I am a perl newbie. I hope you will be patient with me. I have a script that needs to be written in perl. I can't do it in awk or shell scripting. Here is the script: #!/usr/bin/perl use POSIX qw(strftime); use FileHandle; use Getopt::Long; use IO::Handle;... (0 Replies)
Discussion started by: brianjb
0 Replies

8. Shell Programming and Scripting

if condition

if chr1:109457160 1 109457160 99.1735537190083 + chr1:109457233 1 109457233 99.1735537190083 - chr1:109457614 1 109457614 99.1735537190083 + chr1:109457618 1 109457618 100 + chr1:109457943 1 109457943 100 - chr1:109458224 1 109458224 99.1735537190083 - file1.txt If 6th column in... (3 Replies)
Discussion started by: johnkim0806
3 Replies

9. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. Shell Programming and Scripting

[Solved] How to stop script at certain condition?

Hi Gurus, my script likes below if ;then if ; then exit 30 fi if for loop do done I want to if condition1 is true, it exit the execution the script completely with error code 30. but right now it still exe for loop. I try to add below if ;then if ; then ... (3 Replies)
Discussion started by: ken6503
3 Replies
PON(1)								    Debian PPPD 							    PON(1)

NAME
pon, poff, plog - starts up, shuts down or lists the log of PPP connections SYNOPSIS
pon [ isp-name [ options ] ] poff [ -r ] [ -d ] [ -c ] [ -a ] [ -h ] [ isp-name ] plog [ arguments ] DESCRIPTION
This manual page describes the pon, plog and poff scripts, which allow users to control PPP connections. pon pon, invoked without arguments, runs the /etc/ppp/ppp_on_boot file, if it exists and is executable. Otherwise, a PPP connection will be started using configuration from /etc/ppp/peers/provider. This is the default behaviour unless an isp-name argument is given. For instance, to use ISP configuration "myisp" run: pon myisp pon will then use the options file /etc/ppp/peers/myisp. You can pass additional pppd options after the ISP name, too. pon can be used to run multiple, simultaneous PPP connections. pon takes the following command line options: -q --quick disconnect when ip-up finishes running. This function is only available to the root user. poff poff closes a PPP connection. If more than one PPP connection exists, the one named in the argument to poff will be killed, e.g. poff myprovider2 will terminate the connection to myprovider2, and leave the PPP connections to e.g. "myprovider1" or "myprovider3" up and running. poff takes the following command line options: -r causes the connection to be redialed after it is dropped. -d toggles the state of pppd's debug option. -c causes pppd(8) to renegotiate compression. -a stops all running ppp connections. If the argument isp-name is given it will be ignored. -h displays help information. -v prints the version and exits. If no argument is given, poff will stop or signal pppd if and only if there is exactly one running. If more than one connection is active, it will exit with an error code of 1. plog plog shows you the last few lines of /var/log/ppp.log. If that file doesn't exist, it shows you the last few lines of your /var/log/syslog file, but excluding the lines not generated by pppd. This script makes use of the tail(1) command, so arguments that can be passed to tail(1) can also be passed to plog. Note: the plog script can only be used by root or another system administrator in group "adm", due to security reasons. Also, to have all pppd-generated information in one logfile, that plog can show, you need the following line in your /etc/syslog.conf file: local2.* -/var/log/ppp.log FILES
/etc/ppp/options PPPd system options file. /etc/ppp/pap-secrets System PAP passwords file. /etc/ppp/chap-secrets System CHAP passwords file. /etc/ppp/peers/ Directory holding the peer options files. The default file is called provider. /etc/chatscripts/provider The chat script invoked from the default /etc/ppp/peers/provider. /var/log/ppp.log The default PPP log file. AUTHORS
The p-commands were written by Christoph Lameter <clameter@debian.org>. Updated and revised by Philip Hands <phil@hands.com>. This manual was written by Othmar Pasteka <othmar@tron.at>. Modified by Rob Levin <lilo@openprojects.net>, with some extensions taken from the old p-commands manual written by John Hasler <jhasler@debian.org>. SEE ALSO
pppd(8), chat(8), tail(1). Debian Project July 2000 PON(1)
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy