> >>>>> "Puneet" == Puneet Lakhina <[EMAIL PROTECTED]> writes: > Puneet> Hi, > Puneet> I have to frequently find the process ids of particular > processes using a > Puneet> combination of ps and grep. > > You can try 'pidof'[1], if you're simply interested in find pid of a > process :) > > [snipped] > > Puneet> But I was wondering if there was a way for me to specify this > in the regular > Puneet> expression for the first grep itself. > > Puneet> I tried ps -elo pid,args|grep "myprocess\\!(grep)" > > The argument of grep is a regular expression (type 3 language), and > there is no way you can do this in a type 3 language. Even 'grep' also > matches 'grep' text when you pass '-v grep' argument to 'grep' command > line, and then only outputs unmatched lines. > > References: > [1] - http://en.wikipedia.org/wiki/Pidof > >
use pgrep and pkill instead their man page says: "pgrep, pkill - look up or signal processes based on name and other attributes" I use both quite often :-) _______________________________________________ ilugd mailinglist -- ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd Next Event: http://freed.in - February 22/23, 2008 Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi http://www.mail-archive.com/ilugd@lists.linux-delhi.org/