]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/dot2.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / dot2.0
1 # $FreeBSD: head/bin/sh/tests/builtins/dot2.0 208630 2010-05-28 22:40:24Z jilles $
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 unset x
13 echo 'x=2' >testscript
14 . -- ./testscript
15 [ "$x" = 2 ] || failure $LINENO
16 cd / || exit 3
17 x=1
18 PATH=$T:$PATH . -- testscript
19 [ "$x" = 2 ] || failure $LINENO
20
21 test -z "$failures"