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