Tuesday, April 08, 2008

Handling kill signal in shell script

Trap command is a cool utility that handles all hardware signals in a shell script.

trap "echo CtrlC ;exit" SIGINT -> This will echo CtrlC before exiting!!
trap "echo STOP ;exit" SIGTSTP -> This handles a stop signal (ctrl+Z) !!

0 Comments:

Post a Comment

<< Home