Re: pgrep -f 'foo' | wc -l -- curiousity!

2017-08-10 Thread Bill Shirley
-c, --count Suppress normal output; instead print a count of matching processes. When count does not match any‐ thing, e.g. returns zero, the command will return non-zero value. Looks like you would want to use the --count flag instead of piping to wc:

Re: pgrep -f 'foo' | wc -l -- curiousity!

2017-08-09 Thread Jon LaBadie
On Wed, Aug 09, 2017 at 02:06:20PM -0400, bruce wrote: > Hey peeps. > > From a fed/centos cmdline... > > pgrep -f "foo" | wc -l > > will return 0 -- if "foo" doesn't exist in the procTBL, and something > else if "foo" is running. > > The curiousity... When I have a simple php > > >

Re: pgrep -f 'foo' | wc -l -- curiousity!

2017-08-09 Thread Patrick O'Callaghan
On Wed, 2017-08-09 at 14:06 -0400, bruce wrote: > Hey peeps. > > From a fed/centos cmdline... > > pgrep -f "foo" | wc -l > > will return 0 -- if "foo" doesn't exist in the procTBL, and something > else if "foo" is running. > > The curiousity... When I have a simple php > > > $f="pgrep -f

pgrep -f 'foo' | wc -l -- curiousity!

2017-08-09 Thread bruce
Hey peeps. From a fed/centos cmdline... pgrep -f "foo" | wc -l will return 0 -- if "foo" doesn't exist in the procTBL, and something else if "foo" is running. The curiousity... When I have a simple php $t isn't 0!! -- it's actually 1, or something else if foo is running.. Any ideas why??