]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/trap.right
bash-4.3-beta overlay
[thirdparty/bash.git] / tests / trap.right
CommitLineData
d166f048
JA
1subshell exit
2trap -- 'echo exiting' EXIT
3trap -- 'echo aborting' SIGHUP
4trap -- 'echo aborting' SIGINT
5trap -- 'echo aborting' SIGQUIT
6trap -- 'echo aborting' SIGABRT
7trap -- 'echo aborting' SIGTERM
d166f048 8[20] debug
7117c2d2
JA
9debug line
10[22] debug
d166f048
JA
11trap -- 'echo exiting' EXIT
12trap -- 'echo aborting' SIGHUP
13trap -- 'echo aborting' SIGINT
14trap -- 'echo aborting' SIGQUIT
15trap -- 'echo aborting' SIGABRT
16trap -- 'echo aborting' SIGTERM
17trap -- 'echo [$LINENO] debug' DEBUG
d166f048 18[24] debug
7117c2d2
JA
19func[16] funcdebug
20funcdebug line
21[26] debug
d166f048
JA
22trap -- 'echo exiting' EXIT
23trap -- 'echo aborting' SIGHUP
24trap -- 'echo aborting' SIGINT
25trap -- 'echo aborting' SIGQUIT
26trap -- 'echo aborting' SIGABRT
27trap -- 'echo aborting' SIGTERM
28trap -- 'echo [$LINENO] debug' DEBUG
7117c2d2
JA
29[28] debug
30./trap.tests[33] debug
31./trap.tests[34] debug
d3a24ed2 32func2[30] debug
7117c2d2
JA
33func2[31] debug
34func2debug line
35./trap.tests[36] debug
36./trap.tests[38] debug
d166f048
JA
37trap -- 'echo exiting' EXIT
38trap -- 'echo aborting' SIGHUP
39trap -- 'echo aborting' SIGINT
40trap -- 'echo aborting' SIGQUIT
41trap -- 'echo aborting' SIGABRT
42trap -- 'echo aborting' SIGTERM
43trap -- '' DEBUG
44trap -- 'echo exiting' EXIT
45trap -- 'echo aborting' SIGHUP
46trap -- 'echo aborting' SIGINT
47trap -- 'echo aborting' SIGQUIT
48trap -- 'echo aborting' SIGABRT
49trap -- 'echo aborting' SIGTERM
50trap -- 'echo exiting' EXIT
51trap -- '' SIGINT
52trap -- 'echo aborting' SIGQUIT
53trap -- 'echo aborting' SIGABRT
54trap -- 'echo aborting' SIGTERM
28ef6c31 550
3d35553a 56trap -- '' SIGUSR2
f73dda09
JA
57ERRTRAP
58ERRTRAP
59ERRTRAP
60after falses
61if negation ok
62after negation
63after while
64before false in trap2a.sub
65after false in trap2a.sub
66command substitution
c302751c
CR
67+[6] echo 1
681
69+[7] echo 2
702
71+[8] echo 3
72+[8] cat
73+[8] false
74++[8] echo trap: 8
75trap: 8
76+[9] echo 4
774
1a81420a
CR
78exit subshell 1
79current shell
80exit subshell 2
81current shell
82current shell
83current shell
84outside 1
85outside 2
86outside 3
87outside 4
1442f67c
CR
88sleep 2
89wait $!
90exit
91in trap EXIT
92sleep 2
93wait $!
94exit
95in trap EXIT
96works
97bar
98bar
99foo
100trap -- '' SIGINT
101trap -- '' SIGUSR2
102foo
103bar
104foo
105bar
d166f048 106caught a child death
d5362af8
CR
107caught a child death
108caught a child death
d166f048 109trap -- 'echo caught a child death' SIGCHLD
cce855bc
JA
110trap -- 'echo exiting' EXIT
111trap -- 'echo aborting' SIGABRT
112trap -- 'echo caught a child death' SIGCHLD
113trap -- '' SIGUSR2
d166f048 114exiting