2010-05-17 06:26:18 +05:30
|
|
|
trap "echo USR1 received" USR1
|
|
|
|
stub() {
|
|
|
|
echo "sleeping for $1 sec"
|
|
|
|
sleep $1
|
|
|
|
echo "$1 sec passed, sending USR1 to parent"
|
|
|
|
kill -USR1 $$
|
|
|
|
}
|
2010-05-17 13:44:20 +05:30
|
|
|
stub 3 &
|
2010-05-17 06:26:18 +05:30
|
|
|
stub 2 &
|
2010-05-17 13:44:20 +05:30
|
|
|
sleep 1
|
2010-05-17 06:26:18 +05:30
|
|
|
until { echo "Waiting"; wait; } do
|
|
|
|
echo "Wait exit code: $?"
|
|
|
|
done
|
|
|
|
echo "Wait returned 0"
|