grep | grep | grep .... better way ?

David Restall - System Administrator dave at restall.net
Sat Sep 22 21:04:47 UTC 2007


Hi,

> I am using a grep sequence of ..
> 
> ps ax | grep motion | grep -v motion_watchdog.sh | grep -v grep
> 
> is there a way for grep to be used without re-calling it with seperate
> -v's ? I dimly recal there is but man grep left me with a headache :)
> 
> The above returns a true/false depending if script 'motion'  is
> running - ignoreing motion_watchdog & the grep called by grep motion !

Have you tried :-

% man pgrep

:-)


TTFN


Dave
ubuntu/users-2007-09-22.tx             ubuntu-users dave6502 at googlemail.com
+----------------------------------------------------------------------------+
| Dave Restall, Computer Nerd, Cyclist, Radio Amateur G4FCU, Bodger          |
| Mob +44 (0) 7973 831245      Skype: dave.restall             Radio: G4FCU  |
| email : dave at restall.net                     Web : Not Ready Yet :-(       |
+----------------------------------------------------------------------------+
| Happiness adds and multiplies as we divide it with others.                 |
+----------------------------------------------------------------------------+





More information about the ubuntu-users mailing list