Bash: cd sometimes echoing current directory
cd seems to echo the current directory, but other times it seems to do not?
If the CDPATH environment is set and the directory changing to is ambiguous (cd has multiple choices), the new directory will be echo'ed:
$ unset CDPATH # Make sure CDPATH is unset $ cd / $ cd etc # Goto unambiguous path. Nothing is echo'ed $ CDPATH=. $ cd / $ cd etc # Goto ambiguous path (cd has to choose from etc or ./etc). New dir is echo'ed /etc $
- GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
- Installation failure caused by CDPATH environment variable | KernelTrap
- Forum thread about cd-behaviour causing Git install to fail