Simple Script issue..??

David david at damnetwork.net
Wed Dec 10 20:02:19 MST 2008


On Dec 10, 2008, at 6:42 PM, wayne wrote:

> ps -A | grep $1 | cut -c1-5 | grep -o [0123456789]* | kill
>
>
> WILL NOT WORK.
>
> I want to run the above script "whack" like this:   whack  kicker
> which should kill the process "kicker"
>  But it chokes at the "kill" part and I do not know what I'm
> doing.....  and doing wrong  :-)
>
> Anybody?
> ---------------------------------------------------

for i in `ps aux | grep $1 | awk '{ print $2 }'`; do kill $i; done

I have to use this all the time on errant oracle processes :)
David

"I find your lack of faith disturbing."
--Darth Vader





More information about the PLUG-discuss mailing list