Re: new shell in "sh"



Jon LaBadie <jlabadie@xxxxxxxxx> writes:
<snip>
As grep can do the counting also, this can be simplified to:

counter=$(ps -ef | grep -c "[s]endmail")
<snip>
If your system has pgrep, you could also use:

counter=$(pgrep "the_process" | wc -l)

The pgrep I have also has -c giving just

counter=$(pgrep -c "the_process")

--
Ben.
.