#! /bin/sh # Example to show signal handling trap "echo 'Don'\''t Hang me UP, baby'" HUP trap "echo 'Didn'\''t your mummy tell you it'\''s rude to INTerrupt?'" INT trap "echo 'Oh, dont send the TERMinator please!'" TERM trap "echo 'Never QUIT! Don'\''t give up!'" QUIT trap "echo 'I still want my PIPE!'" PIPE trap "echo 'Don'\''t ALaRM me!'" ALRM trap "echo 'Don'\''t make me do something ILLegal!'" ILL trap "echo 'Don'\''t TRAP me!'" TRAP trap "echo 'Don'\''t ABoRT me!'" ABRT trap "echo 'Don'\''t BUS me around!'" BUS trap "echo 'Don'\''t give me that \"floating point exception\" stuff!'" FPE echo My process ID is $$ # So how can we terminate it? # Note: # The colon `:' is the null statement that can be used wherever the # syntax requires a statement. It returns the value 0 (i.e., true). # In this case, it gives us an infinite loop. # Try: # $ help : while : do sleep 1 done # Try running this in one window, and in another window, type this: # for ((i=0;i < 64; ++i));do if ((i==9));then let ++i;fi;echo Sending signal $i:;kill -$i 21306;sleep 1;done # Of course, instead of 21306, put the process ID of this process.