On Wed, Oct 11, 2000 at 04:38:31PM -0700, Bruce J.A. Nourish wrote:
> > if ps -U $LOGNAME | grep realmutt > /dev/null 
> 
> Be careful about using grep to search the output of ps. For example
> 
> $ ps ax | grep lemming
> 16004 tty1     S      0:00 grep lemming
> 
> Y'see? Grep makes a match on its own process.

It works OK on AIX 3.2.5 ps. If you add the -f flag it finds the grep
line, but it does'nt without it.

OK, so maybe my script does'nt work on all systems, but it is worth
playing with to see if some set of ps flags works as required.

Cheers, Brian.
 
> -- 
> [ Bruce J.A. Nourish (email and finger) <[EMAIL PROTECTED]>    ]
> [ GPG key ID BE062236 (75C2 6784 B600 F7F4 E35E  A039 F62C 5AC7 BE06 2236) ]
> [ Fax (775) 665-5938 Phone (480) 763-6970 Pgr (602) 201-3376, ICQ 38344897 ]
> [ Web http://www.kode187.net - Postal: PO Box 51611, Phoenix AZ 85076-1611 ]

-- 
Associate Professor Brian Salter-Duke (Brian Duke) [EMAIL PROTECTED]  
      School of Biological, Environmental and Chemical Sciences, SITE,
Northern Territory University, Darwin, NT 0909, Australia.  Phone 08-89466702. 
Fax 08-89466847          http://www.smps.ntu.edu.au/school/compchem.html

Reply via email to