blob: c8417acf4e689e3ffa8016c3eabbc51761260975 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
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
debug line
[22] 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
[24] debug
func[16] funcdebug
funcdebug line
[26] 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
[28] debug
./trap.tests[33] debug
./trap.tests[34] debug
func2[30] debug
func2[31] debug
func2debug line
./trap.tests[36] debug
./trap.tests[38] 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
ERRTRAP
ERRTRAP
ERRTRAP
after falses
if negation ok
after negation
after while
before false in trap2a.sub
after false in trap2a.sub
command substitution
+[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
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
trap -- '' SIGUSR2
exiting
|