opnsense-src/tools/regression/bin/sh/builtins/cd6.0
Jilles Tjoelker 64fa41f3e1 sh: Correct criterion for using CDPATH in cd.
CDPATH should be ignored not only for pathnames starting with '/' but also
for pathnames whose first component is '.' or '..'.

The man page already describes this behaviour.
2011-05-27 20:01:46 +00:00

10 lines
101 B
Text

# $FreeBSD$
set -e
cd -P /bin
d=$PWD
CDPATH=/:
cd -P .
[ "$d" = "$PWD" ]
cd -P ./
[ "$d" = "$PWD" ]