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 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 !
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"