David Scheidt dsche...@panix.com wrote:
ps ax | grep [s]lapd | wc -l
The [] creates a one-character class that doesn't match the regex.
Doesn't [s]lapd need to be quoted? [] are special to (at least some)
shells.
___
freebsd-questions@freebsd.org
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 13 Jan 2011, per...@pluto.rain.com wrote:
|David Scheidt dsche...@panix.com wrote:
|
| ps ax | grep [s]lapd | wc -l
|
| The [] creates a one-character class that doesn't match the regex.
|
|Doesn't [s]lapd need to be quoted? [] are special
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in the following shell script :
#!/bin/sh
SD=0
SD=`ps -ax | grep slapd | grep -v grep |
just use: pgrep slapd
On 01/12/2011 15:17, four.harris...@googlemail.com wrote:
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in
??
as already answered:
ps ax | awk '/[/]slapd /{n++} END{print n}'
searching '[s]lapd' will avoid grep auto-matching, but would still return
commands like vim /etc/slapd.conf or ./myscript-slapd
about pgrep, like the usual grep, it needs a better expression than the
process name, otherwise it
Date: Wed, 12 Jan 2011 15:01:45 +0100
From: Frank Bonnet f.bon...@esiee.fr
Subject: problem with shell script
Hello
I'm in trouble with a simple shell script that give erroneous value when
running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v
On Thu, 2011-01-13 at 14:45 -0600, Robert Bonomi wrote:
Date: Wed, 12 Jan 2011 15:01:45 +0100
From: Frank Bonnet f.bon...@esiee.fr
Subject: problem with shell script
Hello
I'm in trouble with a simple shell script that give erroneous value when
running ...
If I run commands
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in the following shell script :
#!/bin/sh
SD=0
SD=`ps -ax | grep slapd | grep -v grep |
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote:
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in the
On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com wrote:
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote:
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs
On Wed, Jan 12, 2011 at 4:34 PM, Samuel Martín Moro faus...@gmail.comwrote:
On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.comwrote:
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote:
Hello
I'm in trouble with a simple shell script that give
On Jan 12, 2011, at 10:43 AM, Samuel Martín Moro wrote:
On W
If I run in the following shell script :
#!/bin/sh
SD=0
SD=`ps -ax | grep slapd | grep -v grep | wc -l`
echo $SD
the result is 3 !!!
ps ax | grep [/]slapd | wc -l
ps ax | awk '/[/]slapd /{n++} END{print n}'
On Wed, 12 Jan 2011, Samuel Mart?n Moro wrote:
On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com wrote:
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr wrote:
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run
Quoth Frank Bonnet on Wednesday, 12 January 2011:
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in the following shell script
(2011/01/13 01:00), Warren Block wrote:
On Wed, 12 Jan 2011, Samuel Mart?n Moro wrote:
On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman sunck...@gmail.com
wrote:
On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet f.bon...@esiee.fr
wrote:
I'm in trouble with a simple shell script that give
(2011/01/12 23:01), Frank Bonnet wrote:
Hello
I'm in trouble with a simple shell script that give
erroneous value when running ...
If I run commands interactively everything runs well
ps ax | grep slapd | grep -v grep | wc -l
1
If I run in the following shell script :
#!/bin/sh
SD=0
On Wednesday 12 January 2011 17:58:33 David Scheidt wrote:
ps ax | grep [s]lapd | wc -l
The [] creates a one-character class that doesn't match the regex. Easier
to type and grep should be a bit faster.
And you can save another process by using
ps ax | grep -c '[s]lapd'
Although as
17 matches
Mail list logo