blob: 8c5bb01192e7b4cbec857ae0aff043ce717a625e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# $FreeBSD: head/bin/sh/tests/builtins/exec1.0 213738 2010-10-12 18:20:38Z obrien $
failures=
failure() {
echo "Error at line $1" >&2
failures=x$failures
}
(
exec >/dev/null
echo bad
)
[ $? = 0 ] || failure $LINENO
(
exec ${SH} -c 'exit 42'
echo bad
)
[ $? = 42 ] || failure $LINENO
(
exec /var/empty/nosuch
echo bad
) 2>/dev/null
[ $? = 127 ] || failure $LINENO
test -z "$failures"
|