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

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!brunix!brunix!pew
  3. From: pew@cs.brown.edu (Peter E. Wagner)
  4. Subject: Re: Script for killing mutiple processes?
  5. Message-ID: <1992Jul24.171126.20165@cs.brown.edu>
  6. Sender: news@cs.brown.edu
  7. Organization: Brown University Department of Computer Science
  8. References: <1992Jul21.135406.10224@ncsu.edu>
  9. Date: Fri, 24 Jul 1992 17:11:26 GMT
  10. Lines: 27
  11.  
  12. In article <1992Jul21.135406.10224@ncsu.edu> odkahn@eos.ncsu.edu (Opher D. Kahn) writes:
  13. >I am working with a experimental database server that forks
  14. >off child processes to serve multiple clients.  However, some
  15. >times these processes do not terminate correctly, and I am left
  16. >with 10-15 child processes that need to be killed.  Is it possible
  17. >to somehow pipe the process numbers from 'ps -aux | grep dood' into
  18. >a kill command, so that I don't have to kill each one of them
  19. >manually???  (dood is the name of the process).
  20. >Thanks, 
  21. >
  22.  
  23. kill -9 `ps ax | egrep dood | egrep -v egrep | cut -c1-6` 1>& 2
  24.  
  25. That should do it, though it is very undiscriminating in that it will
  26. kill absolutely everything named 'dood' w/o asking.  I also have a
  27. program called nkill that kills processes by name.  If there is more
  28. than one process with the same name, nkill gives you a list and allows
  29. you to select individual processes or All.  Let me know if you want
  30. the program.  I believe I can distribute it, but it's not ine so I
  31. have to check.
  32.  
  33.     >p
  34.  
  35. ----------------------------------------------------------------
  36. Peter E. Wagner          (212)460-5672        pwagner@ejv.com
  37. 52 E 13th St. Apt. 5E                         pew@BROWNCS.BITNET
  38. New York, NY 10003                            uunet!brunix!pew
  39.