🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #268

Re: Shell signals...

#268
From: Guy Harris
Date: Tue, 16 Oct 1990 02:09
39 lines
2095 bytes
>If there is a newsgroup for shell inquiries, please flame me and with
>the newsgroup name...

There is - "comp.unix.shell" - but it turns out this isn't entirely a
shell inquiry....

>Does anyone have or know the complete list of shell signals(csh/sh/ksh)?
>
>I have a program that traps the ususal ones, but my UNIX guru ran it and then
>did something that emitted a signal that I didn't find(I used 1 2 15).

"Shell signals" are just ordiinary UNIX signals; the signals it lets you
trap are just the ordinary UNIX signals (although some, but not all,
shells won't let you catch signal 11).

Not all UNIX systems use the same signal numbers for the same signals. 
The signals up to 15 are the same on most if not all UNIX systems;
others differ more.  Ultimately, the shell will let you catch signals by
name rather than by number, so you can write more portable shell scripts
(I think it'll also turn the signal numbers, in effect, into names, so
signal 1 will be SIGHUP even if SIGHUP isn't 1 on the system).

Some signals *CANNOT* be caught, no matter how nicely you ask; signal
SIGKILL, normally signal 9, cannot be caught (this allows you to kill
off a process that has protected itself from all other signals, and is a
useful escape hatch).

The signals you caught are probably the only ones you *should* catch. 
Other signals either:

1) are caused by bugs in the shell, and shouldn't be caught;

2) can't be caught, such as SIGKILL;

3) have a default action of "ignore", and as such aren't worth catching;

4) are used for other purposes, e.g. stopping a job on a system with job
   control, and should only be caught if you have some good reason not
   to let a job running your shell script be caught.
Technical Details
Message-ID: <2208@megadon.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker!apple!altos!megadon!clp

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker!apple!altos!megadon!clp
From: guy@auspex.auspex.com (Guy Harris)
Newsgroups: comp.unix
Subject: Re: Shell signals...
Message-ID: <2208@megadon.UUCP>
Date: 16 Oct 90 02:09:20 GMT
Sender: clp@megadon.UUCP
Lines: 39
Approved: clp@megadon.UUCP