]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/return4.0
be5582b458b4eb29fc5c601825afc93f65913882
[apple/shell_cmds.git] / sh / tests / builtins / return4.0
1 # $FreeBSD$
2
3 failures=
4 failure() {
5 echo "Error at line $1" >&2
6 failures=x$failures
7 }
8
9 T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit
10 trap 'rm -rf $T' 0
11 cd $T || exit 3
12 echo 'return 42; exit 4' >testscript
13 . ./testscript
14 [ "$?" = 42 ] || failure $LINENO
15
16 test -z "$failures"