busybox/shell/hush_test/hush-trap/catch.tests
2009-03-29 23:49:46 +00:00

21 lines
280 B
Plaintext
Executable File

# 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