--- /dev/null
+sending USR2
+caught
+sending USR2
+sending USR2
--- /dev/null
+# avoid ugly warnings about signals not being caught
+trap ":" USR1 USR2
+
+hush -c '
+trap "echo caught" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+trap "" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+trap "-" USR2
+echo "sending USR2"
+kill -USR2 $$
+
+echo "not reached"
+'
+
+trap "-" USR1 USR2
--- /dev/null
+hush -c 'trap "echo cow" 0'
+hush -c 'trap "echo moo" EXIT'
+hush -c 'trap "echo no" 0; trap 0'
--- /dev/null
+# make sure we do not corrupt $? across traps
+trap "echo YEAH; false" USR1
+kill -USR1 $$
+echo $?
--- /dev/null
+___
+___
+___
+trap -- 'a' EXIT
+trap -- 'a' INT
+trap -- 'a' USR1
+trap -- 'a' USR2
+___
+___
+trap -- 'a' USR1
+trap -- 'a' USR2
+___
+___
+trap -- 'a' USR2
--- /dev/null
+# no output -- default state
+echo ___
+trap
+
+# assign some traps
+echo ___
+trap "a" EXIT INT USR1 USR2
+
+# show them all
+echo ___
+trap
+
+# clear one
+echo ___
+trap 0 INT
+echo ___
+trap
+
+# clear another
+echo ___
+trap "-" USR1
+echo ___
+trap