[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kill script



Hi David!

On Wed, 23 Feb 2000, David Wiard wrote:

> i'm looking for a script/command that will do something equivalent to:
> 
> 	ps -e | grep <prog name>
> 	kill -9 <all occurances of said program>
> 
> does anybody have something that will do this?  i don't know how to
> script well enough to do a script like this myself, yet.

You don't need a script for this one :)

try the following:

function mykillall { 
  kill -9 `ps -e | 
    grep bash |
    grep -v grep |
    awk ' { print $1 } '`
}

as an alternative you can use the real killall :)

-- 
Weasel                            http://www.cosy.sbg.ac.at/~ppalfrad/
PGP/GPG encrypted messages prefered. See my site or finger -l ppalfrad
----------------------------------------------------------------------
          Yes means No and No means Yes. Delete all files [Y]?

Attachment: pgpJ3MUEoPztu.pgp
Description: PGP signature


Reply to: