blob: 34e24cceba101349a14e443fd491b1fc90fb2180 (
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
|
# no output -- default state
echo ___
trap
# assign some traps
echo ___
trap "a" EXIT INT USR1 USR2
# show them all
echo ___
trap
# show them by command substitution
echo ___
echo $(trap)
# show them by pipe
echo ___
trap | cat
# show them by process substitution
echo ___
cat <(trap)
# clear one
echo ___
trap 0 INT
echo ___
trap
# clear another
echo ___
trap "-" USR1
echo ___
trap
|