opnsense-src/tools/regression/bin/sh/builtins/cd7.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

15 lines
180 B
Text

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