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

<?php

$f="pgrep -f 'foo' | wc -l";
$t=`$f`;
print $t

?>

$t isn't 0!! -- it's actually 1, or something else if foo is running..

Any ideas why?? I've used the different methods php provides to "run"
shell/.cmdline processes. I get the same results.

Now.. I can do something like
 ps aux | grep 'foo' | grep -v 'grep' | wc -l
and get the correct results within the php as well as the shell.

Didn't find anything via the 'net or SO on this..

Thoughts/comments??
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to