diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:38:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:38:56 +0000 |
commit | 6c20c8ed2cb9ab69a1a57ccb2b9b79969a808321 (patch) | |
tree | f63ce19d57fad3ac4a15bc26dbfbfa2b834111b5 /tests/trap.right | |
parent | Initial commit. (diff) | |
download | bash-upstream.tar.xz bash-upstream.zip |
Adding upstream version 5.2.15.upstream/5.2.15upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/trap.right')
-rw-r--r-- | tests/trap.right | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/tests/trap.right b/tests/trap.right new file mode 100644 index 0000000..4338ff4 --- /dev/null +++ b/tests/trap.right @@ -0,0 +1,115 @@ +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 +[33] debug +debug line +[35] 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 [$LINENO] debug' DEBUG +[37] debug +func[29] funcdebug +funcdebug line +./trap.tests[39] funcdebug +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 ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG +./trap.tests[41] funcdebug +./trap.tests[46] debug +./trap.tests[47] debug +func2[43] debug +func2[44] debug +func2debug line +./trap.tests[49] debug +./trap.tests[51] 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 -- '' 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 +0 +trap -- '' SIGUSR2 +ERRTRAP +ERRTRAP +ERRTRAP +after falses +if negation ok +after negation +after while +before false in trap2a.sub +after false in trap2a.sub +command substitution +ERRTRAP +ERRTRAP +bar +ERRTRAP +ERRTRAP +ERRTRAP +ERRTRAP +ERRTRAP ++[6] echo 1 +1 ++[7] echo 2 +2 ++[8] false ++[8] false ++[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 +fn +after 1 +fn +after 2 +caught a child death +caught a child death +caught a child death +trap -- 'echo caught a child death' SIGCHLD +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo caught a child death' SIGCHLD +exiting |