Files
bash/tests/jobs9.sub
2024-04-25 15:50:39 -04:00

15 lines
510 B
Plaintext

# When the shell is waiting, by means of the wait utility, for asynchronous
# commands to complete, the reception of a signal for which a trap has been
# set shall cause the wait utility to return immediately with an exit status
# >128, immediately after which the trap associated with that signal shall be
# taken.
trap 'echo got $(kill -l $BASH_TRAPSIG)' USR1
sleep 10 &
( sleep 2 ; kill -USR1 $$ ) &
# should be interrupted by the signal
wait
[[ $? -gt 128 ]] || echo 'wait status not greater than 128'