]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/regression/bin/sh/builtins/cd1.0
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / regression / bin / sh / builtins / cd1.0
1 # $FreeBSD$
2 set -e
3
4 P=${TMPDIR:-/tmp}
5 cd $P
6 T=$(mktemp -d sh-test.XXXXXX)
7
8 chmod 0 $T
9 cd -L $T 2>/dev/null && exit 1
10 [ "$PWD" = "$P" ]
11 [ "$(pwd)" = "$P" ]
12 cd -P $T 2>/dev/null && exit 1
13 [ "$PWD" = "$P" ]
14 [ "$(pwd)" = "$P" ]
15
16 chmod 755 $T
17 cd $T
18 mkdir -p 1/2/3
19 ln -s 1/2 link1
20 ln -s 2/3 1/link2
21 (cd -L 1/../1 && [ "$(pwd -L)" = "$P/$T/1" ])
22 (cd -L link1 && [ "$(pwd -L)" = "$P/$T/link1" ])
23 (cd -L link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])
24 (cd -P link1 && [ "$(pwd -L)" = "$P/$T/1/2" ])
25 (cd -P link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])
26
27 rm -rf ${P}/${T}