xref: /freebsd/bin/sh/tests/builtins/trap5.0 (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
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