1 # $FreeBSD: head/bin/sh/tests/builtins/cd1.0 228975 2011-12-30 00:04:11Z uqs $
6 T=$(mktemp -d sh-test.XXXXXX)
9 if [ `id -u` -ne 0 ]; then
10 # Root can always cd, regardless of directory permissions.
11 cd -L $T 2>/dev/null && exit 1
14 cd -P $T 2>/dev/null && exit 1
24 (cd -L 1/../1 && [ "$(pwd -L)" = "$P/$T/1" ])
25 (cd -L link1 && [ "$(pwd -L)" = "$P/$T/link1" ])
26 (cd -L link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])
27 (cd -P link1 && [ "$(pwd -L)" = "$P/$T/1/2" ])
28 (cd -P link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])