1# $FreeBSD$ 2 3set -e 4trap - USR1 5initial=$(trap) 6trap -- -l USR1 7added=$(trap) 8[ -n "$added" ] 9trap - USR1 10second=$(trap) 11[ "$initial" = "$second" ] 12eval "$added" 13added2=$(trap) 14added3=$(trap --) 15[ "$added" = "$added2" ] 16[ "$added2" = "$added3" ] 17trap -- - USR1 18third=$(trap) 19[ "$initial" = "$third" ] 20