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