Hi,
I have to frequently find the process ids of particular processes using a
combination of ps and grep.
For e.g.

ps -elo pid,args|grep myprocess

But the problem with above is that it gives me a line for the grep process
also.

e.g
213456 /home/puneet/myprocess
219876 grep myprocess

The way I got around this was by using a further pipe

ps -elo pid,args|grep myprocess|grep -v grep

But I was wondering if there was a way for me to specify this in the regular
expression for the first grep itself.

I tried ps -elo pid,args|grep "myprocess\\!(grep)"

But this does not give any output. I escaped the ! as without the escape it
is considered by the shell as history lookup and it gives me no event found.

-- 
Puneet
http://sahyog.blogspot.com/
Latest Post: Tutorial on SVN setup and usage
_______________________________________________
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/

Reply via email to