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