signal5.tests 261 B

1234567891011121314
  1. trap "echo USR1 received" USR1
  2. stub() {
  3. echo "Sleeping"
  4. sleep $1
  5. echo "$1 sec passed, sending USR1 to parent"
  6. kill -USR1 $$
  7. }
  8. stub 3 &
  9. stub 2 &
  10. sleep 1
  11. until { echo "Waiting"; wait; } do
  12. echo "Wait exit code: $?"
  13. done
  14. echo "Wait returned 0"