]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/builtins/cd5.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / cd5.0
CommitLineData
71aad674
A
1# $FreeBSD$
2
3set -e
4T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXX")
5trap 'rm -rf "$T"' 0
6
7cd -P "$T"
8D=$(pwd)
9
10mkdir a a/1 b b/1 b/2
11
12CDPATH=$D/a:
13# Basic test.
14cd 1 >/dev/null
15[ "$(pwd)" = "$D/a/1" ]
16# Test that the current directory is not checked before CDPATH.
17cd "$D/b"
18cd 1 >/dev/null
19[ "$(pwd)" = "$D/a/1" ]
20# Test not using a CDPATH entry.
21cd "$D/b"
22cd 2
23[ "$(pwd)" = "$D/b/2" ]