File: jobs9.sub

package info (click to toggle)
bash 5.3-2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 44,432 kB
  • sloc: ansic: 134,747; sh: 8,866; yacc: 5,966; makefile: 4,697; perl: 4,105; asm: 48; awk: 23; sed: 16
file content (14 lines) | stat: -rw-r--r-- 510 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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'