xref: /freebsd/bin/sh/tests/builtins/wait1.0 (revision e1c4c8dd8d2d10b6104f06856a77bd5b4813a801)
1
2failures=
3failure() {
4	echo "Error at line $1" >&2
5	failures=x$failures
6}
7
8exit 4 & p4=$!
9exit 8 & p8=$!
10wait $p4
11[ $? = 4 ] || failure $LINENO
12wait $p8
13[ $? = 8 ] || failure $LINENO
14
15exit 3 & p3=$!
16exit 7 & p7=$!
17wait $p7
18[ $? = 7 ] || failure $LINENO
19wait $p3
20[ $? = 3 ] || failure $LINENO
21
22test -z "$failures"
23