(2011/01/12 23:01), Frank Bonnet wrote:
HelloI'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 | wc -l` echo $SD the result is 3 !!! Any info welcome ! _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questionsTo unsubscribe, send any mail to "[email protected]"
hello. i would rather use pgrep(1); pgrep -afl slapd for just counting purpose, pgrep -a slapd | wc -l is enough. it should work as expected in `` output. _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
