[aclug-L] Re: script to kill
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [aclug-L] script to kill, glandix, 2000/03/21
- [aclug-L] Re: script to kill, Tom Hull, 2000/03/22
- [aclug-L] Re: script to kill, Carl D Cravens, 2000/03/22
- [aclug-L] Re: script to kill, Tom Hull, 2000/03/22
- [aclug-L] Re: script to kill, Carl D Cravens, 2000/03/22
[aclug-L] Re: script to kill, John Goerzen, 2000/03/22
[aclug-L] Re: script to kill, Brian Chapman, 2000/03/23
|
|