summaryrefslogtreecommitdiffhomepage
path: root/tests/posix/wait-reap.sh
blob: 4744f4e86223600b864d872f3738b67f9b1c95be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# `wait` knows the status of a background job after it was reaped, also when
# that job was not the most recent one and so not the one `$!` names.
false & a=$!
true & b=$!
sleep 0.3
:
wait $a; echo "wait a: $?"
wait $a; echo "again: $?"
false & c=$!
true & d=$!
sleep 0.3
wait $c $d; echo "both: $?"
wait; echo "all: $?"