summaryrefslogtreecommitdiffhomepage
path: root/shell/ash_test/ash-signals/signal1.tests
blob: 098d21fd4993c936b1bec4a3181a16321b0b85f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
trap "echo got signal" USR1

for try in 1 2 3 4 5; do
    kill -USR1 $$
    sleep 0.2
    echo "sent $try signal"
done &

sleep 2 &

sleeping=true
while $sleeping; do
    trap
    if wait %%; then
        echo "sleep completed"
        sleeping=false
    elif [ $? == 127 ]; then
        echo "BUG: no processes to wait for?!"
        sleeping=false
    else
        echo "wait interrupted"
    fi
done