]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/builtins/dot1.0
shell_cmds-203.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / dot1.0
1 # $FreeBSD: head/bin/sh/tests/builtins/dot1.0 208629 2010-05-28 22:08:34Z 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"