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