Re: Programming hints.
"C.J.LAWSON" wrote:
>
>
>On Mon, 23 Mar 1998 shaul@rakefet.debian.org wrote:
>
>> > What about CTRL + C. Is that a signal?
>>
>> Yes it is. I don't know what signal exactly it is. SIGINT ? SIGTERM ?
Strictly speaking, ctrl-c can be made to generate SIGINT, and this is the
default in Debian. However, this can be changed by the command stty.
Many systems use <DEL> instead of ctrl-c
>> > If not, how can a do something before
>> > exiting from CTRL + C?
>What you want to do is catch the signal. Typically it will require the
>signal function ("man signal"), you have to rewrite a function to do what
>you want and then install that as the defacto signal handler ... There is
>(if my memory serves me right) an example in the book, the "Joy of C"
>(local lib) and I think some other ones in Plauger's book (I hope that is
>the spelling of his name).
I missed the beginning of this thread, so this may be right off the point
for the original poster:
In shell script, use trap to catch a signal and do something before exit
(or just ignore it completely). You can't catch signal 9 (SIGKILL) and
one or two others.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: