home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9434 < prev    next >
Encoding:
Text File  |  1992-07-26  |  1.3 KB  |  31 lines

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