4 trap 'echo aborting' 1 2 3 6 15
6 # make sure a user-specified subshell runs the exit trap, but does not
7 # inherit the exit trap from a parent shell
8 ( trap 'echo subshell exit' 0; exit 0 )
15 trap 'echo [$LINENO] funcdebug' DEBUG
19 trap 'echo [$LINENO] debug' DEBUG
43 # hmmm...should this set the handling to SIG_IGN for children, too?
48 # show that setting a trap on SIGCHLD is not disastrous.
52 trap 'echo caught a child death' SIGCHLD
54 sleep 7 & sleep 6 & sleep 5 &
60 # Now reset some of the signals the shell handles specially back to
61 # their default values (with or without the SIG prefix)