# `--` ends `cd`'s options, and a directory reached through the fallback must # record where it really is, not the logical path that failed. "$TSH" -c 'cd -- /tmp && pwd' "$TSH" -c 'cd -P -- /tmp && pwd' "$TSH" -c 'cd /tmp; cd -- - >/dev/null; echo "rc=$?"' mkdir -p d/sub "$TSH" -c 'cd d; PWD=/bogus; cd sub case $PWD in */bogus/*) echo "wrong $PWD" ;; *) echo "pwd ok" ;; esac'