in reply to SIG and system
The easiest way to do this in this particular case is not to catch a signal, but to check the lower eight bits of the exit code from system. It will usually indicate the signal number the child received. I say "usually" since if you are actually launching a shell, esp. with pipelineing, they don't always behave nicely (i.e. make sure you test).