home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5220 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  1.1 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!gdt!ccsis
  2. From: ccsis@sunlab1.bath.ac.uk (Icarus Sparry)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: trap
  5. Message-ID: <C06rMH.3u3@sunlab1.bath.ac.uk>
  6. Date: 1 Jan 93 17:38:57 GMT
  7. References: <1860@wshb.csms.com>
  8. Organization: Bath University Computing Services, UK
  9. Lines: 23
  10.  
  11. In the referenced article, calvin@wshb.csms.com ( WSHB employee) writes:
  12. >
  13. >  trap "rm $LOCATE1/LCK..Order $LOCATE3/$$.*; clear; exit" 0 1 2 9 15
  14. >
  15.  
  16. Trap 1 is called when the process receives 'SIGHUP'. Typically this
  17. is when you hang up you modem, or disconnect your terminal, close your
  18. X window.
  19.  
  20. Trap 2 is called when the process receives 'SIGINT'. Typically this is
  21. because you have typed the keyboard interrupt character, Control-C or
  22. Delete are common choices for this character
  23.  
  24. Trap 9 is never called
  25.  
  26. Trap 15 is called when the process receives 'SIGTERM'. Typically this is
  27. because you used the 'kill' command to kill this process.
  28.  
  29. Trap 0 is special. It is called when the script finishes. This is what is
  30. happening in your case. The obvious thing to do is to redefine the trap
  31. command just before you call 'exit 3'. Something like
  32.  
  33.     trap '' 0 ; exit 3
  34.