home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4588 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.7 KB  |  52 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!emory!athena.cs.uga.edu!marie!david
  3. From: david@marie.stat.uga.edu (David Gundlach)
  4. Subject: Re: suicidal kill command ?
  5. Message-ID: <1992Nov7.193838.18009@athena.cs.uga.edu>
  6. Sender: news@athena.cs.uga.edu
  7. Organization: UGA Statistics Department
  8. References: <1992Oct31.192155.3021@nic.csu.net <1992Nov3.022415.12993@athena.cs.uga.edu> <TTN.92Nov6024042@sepelrastas.cs.tut.fi>
  9. Date: Sat, 7 Nov 1992 19:38:38 GMT
  10. Lines: 40
  11.  
  12. And then in <TTN.92Nov6024042@sepelrastas.cs.tut.fi>, ttn@cs.tut.fi (Tero Nieminen) said...
  13. % In article <1992Nov3.022415.12993@athena.cs.uga.edu> david@marie.stat.uga.edu (David Gundlach) writes:
  14. %    Here it is, a one-line shell script:
  15. %    echo "Killing '$1' processes..."; kill $2 `ps -agux | grep $1 | sort | awk '{print $2}'`
  16. % One useful thing to chek is "which kill". It might say "kill: shell
  17. % built-in command". In that case you have to use another kill for the job
  18.  
  19. Oops; mine does.  A tcsh user :-)
  20.  
  21. % (ie. /bin/kill -9 -1). That does the tric on machines over here.
  22.  
  23. Of course, this was a shell script, and I program all of my scripts
  24. (well, nearly all) in sh, so it worked and I never knew about the
  25. problem.  Hully gee.
  26.  
  27. % At least csh/tcsh users should watch out for this..
  28.  
  29. Thanks :-)
  30.  
  31. % --
  32. %      Tero Nieminen                 Tampere University of Technology
  33. %      ttn@cs.tut.fi                     Tampere, Finland, Europe
  34.  
  35.  
  36.  
  37. :-D
  38. --
  39. David Gundlach                david@marie.stat.uga.edu
  40. System Support and Integration        david@rolf.stat.uga.edu
  41. UGA Statistics                david@castor.cs.uga.edu
  42. University of Georgia            david@groucho.dev.uga.edu
  43. 706/542-3289 or 706/542-5232        BITNET: statuga@uga
  44.  
  45. "I think, therefore I am wrong." --     me
  46.  
  47.  
  48.