Im confused about this bash option:
-P
If set, do not resolve symbolic links when performing commands such as cd which change the current directory. The physical directory is used instead. By default, Bash follows the logical chain of directories when performing commands which change the current directory.
For example, if /usr/sys is a symbolic link to /usr/local/sys then: $ cd /usr/sys; echo $PWD /usr/sys $ cd ..; pwd /usr If set -P is on, then: $ cd /usr/sys; echo $PWD /usr/local/sys $ cd ..; pwd /usr/local
I thought resolve means to follow? e.g /usr/sys points at /usr/local/sys, so it would get resolved to /usr/local/sys.
But the example above says that when set -P
is on, /usr/sys becomes /usr/local/says? Even though it says if its on it shouldnt resolve symbolic links
/usr/sys
instead of in/usr/local/sys
. Withset -P
, bash doesn't do anything by itself and lets the underlying system behaviour show (which is also to resolve the symlink, but now it's impossible to be in/usr/sys
).