#! /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 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