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