aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-signals/catch.tests
blob: 4b1a08e8f51f8c182a9f9800762c9388ec5b8010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# If job control is disabled, skip the test ("User defined signal 2" text not emitted)
test "`type jobs`" = "jobs is a shell builtin" || exit 77

# avoid ugly warnings about signals not being caught
trap ":" USR1 USR2

"$THIS_SH" -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