Re: new shell in "sh"
- From: Ben Bacarisse <ben.usenet@xxxxxxxxx>
- Date: Fri, 08 Jan 2010 21:41:48 +0000
Jon LaBadie <jlabadie@xxxxxxxxx> writes:
<snip>
As grep can do the counting also, this can be simplified to:<snip>
counter=$(ps -ef | grep -c "[s]endmail")
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.
.
- References:
- new shell in "sh"
- From: Moody
- Re: new shell in "sh"
- From: OldSchool
- Re: new shell in "sh"
- From: Jon LaBadie
- new shell in "sh"
- Prev by Date: Re: bash first occurrence in log file
- Next by Date: Sorting
- Previous by thread: Re: new shell in "sh"
- Next by thread: Re: new shell in "sh"
- Index(es):