Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-Waiting
-sleeping for 1 sec
+sleeping for 3 sec
sleeping for 2 sec
-1 sec passed, sending USR1 to parent
+Waiting
+2 sec passed, sending USR1 to parent
USR1 received
Wait exit code: 138
Waiting
-2 sec passed, sending USR1 to parent
+3 sec passed, sending USR1 to parent
USR1 received
Wait exit code: 138
Waiting
echo "$1 sec passed, sending USR1 to parent"
kill -USR1 $$
}
+stub 3 &
stub 2 &
-stub 1 &
+sleep 1
until { echo "Waiting"; wait; } do
echo "Wait exit code: $?"
done