xref: /freebsd/bin/sh/tests/builtins/trap5.0 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1
2set -e
3trap - USR1
4initial=$(trap)
5trap -- -l USR1
6added=$(trap)
7[ -n "$added" ]
8trap - USR1
9second=$(trap)
10[ "$initial" = "$second" ]
11eval "$added"
12added2=$(trap)
13added3=$(trap --)
14[ "$added" = "$added2" ]
15[ "$added2" = "$added3" ]
16trap -- - USR1
17third=$(trap)
18[ "$initial" = "$third" ]
19