xref: /freebsd/bin/sh/tests/builtins/wait1.0 (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
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