On Thu, Jan 19, 2012 at 04:47:04PM +0400, Wesley M. wrote: > Therefore if i run > manually this : trap 'ctrl-c detected!' 2 > it works. But trap 'echo Kill > detected!' 9 doesn't work. > Why ? Why i can't use it in a script?
RTFM from signal(3): Except for the SIGKILL and SIGSTOP signals, the signal() function allows for any signal to be caught, to be ignored, or to generate an interrupt. These signals are defined in the file <signal.h>: now, guess what number corresponds to SIGKILL.