In the bash man page's section for "cd" it says

An argument of - is equivalent to $OLDPWD. If a non-empty directory
name from CDPATH is used, or if -
is the first argument, and the directory change is successful, the
absolute pathname of the new working directory
is written to the standard output.

The first sentence is potentially confusing as "cd -" is not 100%
equivalent to "cd $OLDPWD". I would word
the above as

If a non-empty directory name from CDPATH is used, or if - is the
first argument, and the directory change is
successful, the absolute pathname of the new working directory is
written to the standard output. An argument
of - is otherwise equivalent to $OLDPWD.

Jason

Reply via email to