i-bash/tests/trap.right

105 lines
2.1 KiB
Text
Raw Normal View History

1997-06-05 14:59:13 +00:00
subshell exit
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
[20] debug
2002-07-17 14:10:11 +00:00
debug line
[22] debug
1997-06-05 14:59:13 +00:00
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- 'echo [$LINENO] debug' DEBUG
[24] debug
2002-07-17 14:10:11 +00:00
func[16] funcdebug
funcdebug line
[26] debug
1997-06-05 14:59:13 +00:00
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- 'echo [$LINENO] debug' DEBUG
2002-07-17 14:10:11 +00:00
[28] debug
./trap.tests[33] debug
./trap.tests[34] debug
2004-07-27 13:29:18 +00:00
func2[30] debug
2002-07-17 14:10:11 +00:00
func2[31] debug
func2debug line
./trap.tests[36] debug
./trap.tests[38] debug
1997-06-05 14:59:13 +00:00
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- '' DEBUG
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGHUP
trap -- 'echo aborting' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
trap -- 'echo exiting' EXIT
trap -- '' SIGINT
trap -- 'echo aborting' SIGQUIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo aborting' SIGTERM
2001-04-06 19:14:31 +00:00
0
trap -- '' SIGUSR2
2001-11-13 17:56:06 +00:00
ERRTRAP
ERRTRAP
ERRTRAP
after falses
if negation ok
after negation
after while
before false in trap2a.sub
after false in trap2a.sub
command substitution
2011-11-21 20:51:19 -05:00
+[6] echo 1
1
+[7] echo 2
2
+[8] echo 3
+[8] cat
+[8] false
++[8] echo trap: 8
trap: 8
+[9] echo 4
4
exit subshell 1
current shell
exit subshell 2
current shell
current shell
current shell
outside 1
outside 2
outside 3
outside 4
sleep 2
wait $!
exit
in trap EXIT
sleep 2
wait $!
exit
in trap EXIT
2011-11-21 20:51:19 -05:00
caught a child death
caught a child death
1997-06-05 14:59:13 +00:00
caught a child death
trap -- 'echo caught a child death' SIGCHLD
1998-04-17 19:52:44 +00:00
trap -- 'echo exiting' EXIT
trap -- 'echo aborting' SIGABRT
trap -- 'echo caught a child death' SIGCHLD
trap -- '' SIGUSR2
1997-06-05 14:59:13 +00:00
exiting