home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!doc.ic.ac.uk!uknet!mcsun!news.funet.fi!news.cs.tut.fi!tut!ttn
- From: ttn@cs.tut.fi (Tero Nieminen)
- Newsgroups: comp.unix.shell
- Subject: Re: suicidal kill command ?
- Message-ID: <TTN.92Nov6024042@sepelrastas.cs.tut.fi>
- Date: 6 Nov 92 02:40:42 GMT
- References: <1c7cd5INNk5l@coral.bucknell.edu <mark.719898510@coombs
- <1992Oct31.192155.3021@nic.csu.net
- <1992Nov3.022415.12993@athena.cs.uga.edu>
- Organization: Tampere Univ. of Technology, Finland.
- Lines: 19
- NNTP-Posting-Host: sepelrastas.cs.tut.fi
- In-reply-to: david@marie.stat.uga.edu's message of Tue, 3 Nov 1992 02:24:15 GMT
-
- In article <1992Nov3.022415.12993@athena.cs.uga.edu> david@marie.stat.uga.edu (David Gundlach) writes:
-
- I don't know of a way to actually make kill do this by itself, but
- I've whipped up a 'kp' script (originally for 'kill program') that
- does the job. And after all, aren't you suppposed to build new tools
- out of existing ones? ;-)
-
- Here it is, a one-line shell script:
-
- echo "Killing '$1' processes..."; kill $2 `ps -agux | grep $1 | sort | awk '{print $2}'`
-
- One useful thing to chek is "which kill". It might say "kill: shell
- built-in command". In that case you have to use another kill for the job
- (ie. /bin/kill -9 -1). That does the tric on machines over here.
-
- At least csh/tcsh users should watch out for this..
- --
- Tero Nieminen Tampere University of Technology
- ttn@cs.tut.fi Tampere, Finland, Europe
-