busybox/shell/ash_test/ash-signals/signal1.tests
2008-02-13 18:09:56 +00:00

25 lines
381 B
Plaintext
Executable File

sleeping=true
trap "echo got signal" USR1
for try in 1 2 3 4 5; do
kill -USR1 $$
sleep 1
echo sent $try signal
done &
sleep 10 &
while $sleeping; do
trap
if wait %%; then
echo sleep completed
sleeping=false
elif [ $? == 127 ]; then
echo no sleep tonite
sleeping=false
else
echo sleep interrupted;
fi
done