home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!psinntp!hyphenw!dwight
- From: dwight@hyphen.com (Dwight Ernest)
- Subject: Re: Script for killing mutiple processes?
- Message-ID: <1992Jul25.223315.10006@hyphen.com>
- Organization: Hyphen, Inc., Wilmington, MA 01887 USA / +1 508 988-0880
- References: <1992Jul21.135406.10224@ncsu.edu> <RDORICH.92Jul21152432@jade.tufts.edu> <1992Jul23.042717.25661@news.eng.convex.com>
- Date: Sat, 25 Jul 1992 22:33:15 GMT
- Lines: 20
-
- tchrist@convex.COM (Tom Christiansen) writes:
- >From the keyboard of rdorich@jade.tufts.edu (Rob):
- >:In order to kill many jobs running on the background, I ususally use
- >:the following trick:
- >:
- >:kill -9 `ps -aux | grep myname | grep filename | awk '{print $2}'`
-
- >Come now. You've got an awk going. Just what do you need a grep
- >for, let alone two of them?
-
- >You're also not being very careful about suicide.
-
- And a -9 signal will overcome any signal handler that a careful
- programmer may have put into the target of the kill to do cleanup.
- A -15 should be tried first, then a short sleep, and if the process
- still exists, then and only then should a -9 be sent.
- --
- --Dwight A. Ernest Special Projects Engineer I speak only for myself.
- Hyphen, Inc. / 187 Ballardvale St. / Wilmington, MA 01887 / +1 508 988 0880
- dae@world.std.com dwight@hyphen.com
-