# 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'
