Complete.Org: Mailing Lists: Archives: discussion: March 2000:
[aclug-L] Re: script to kill
Home

[aclug-L] Re: script to kill

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: script to kill
From: Carl D Cravens <raven@xxxxxxxxxxx>
Date: Wed, 22 Mar 2000 07:43:23 -0600 (CST)
Reply-to: discussion@xxxxxxxxx

On Wed, 22 Mar 2000, Tom Hull wrote:

> $ ps -e | awk '$4==PROG{print $1}' PROG=init -

This doesn't produce any output on my box.  (And 'ps e' under Debian 2.0
has the progname in the fifth field, too.)  This works...

ps e |awk '$5 ~ /PROG/ {print $1}'

...where PROG is the name of the program you're looking for.  (Looking at
the man page, it looks like == is a numerical operator... I can get it to
match numbers, but not strings.)  

I should learn more about awk... this method is a lot simpler than my
usual... 

ps e | grep PROG | grep -v grep | awk '{print $1}'

--
Carl D Cravens (raven@xxxxxxxxxxx)
I sue you, you pay me, Lit-i-ga-tions fun, you'll see.


-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]