home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / ultrix / 8961 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.1 KB  |  31 lines

  1. Newsgroups: comp.unix.ultrix,chevron.unix
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!sal.wisc.edu!alan
  3. From: alan@sal.wisc.edu (Alan Watson)
  4. Subject: Re: Kill Session Manager on a Ultrix workstation
  5. Message-ID: <1992Dec18.171522.13250@sal.wisc.edu>
  6. Keywords: kill session manager
  7. Organization: Space Astronomy Lab, Madison WI
  8. References: <1992Dec18.142356@abds9.aberdeen.chevron.com>
  9. Date: Fri, 18 Dec 1992 17:15:22 GMT
  10. Lines: 19
  11.  
  12. In article <1992Dec18.142356@abds9.aberdeen.chevron.com> emjga@aberdeen.chevron.com writes:
  13. >I would like to be able to kill the Session Manager and all its 
  14. >sup-process without having to click on the Session manager window
  15. >and select the quit option.
  16. >
  17. >Currently I have a small script called xsmkill to do this.
  18. >#!/bin/csh
  19. >set x = `ps -aux | grep $USER | grep dxsession | awk '{print $2}'`
  20. >kill -9 $x
  21.  
  22. You need to filter out the grep (or awk) command from the output of ps,
  23. and it is more gentle to send SIGTERM rather than SIGKILL.
  24.  
  25. #! /bin/sh
  26. PID=`ps -ax | awk '/dxsession/ && !/awk/ {print $1}'`
  27. kill -TERM $PID
  28. # end-of-file
  29.  
  30. You only need to grep on $USER if you are running a twin-headed 5000/25.
  31.