In article <firstname.lastname@example.org>,
Michael Wang <email@example.com> wrote:
>Barry Margolin <firstname.lastname@example.org> wrote:
>Let us see an example,
>/usr/local -> /opt/ulocal
>when I am in /usr/local which is the same as /opt/ulocal,
>what pwd should give?
/bin/pwd must say /opt/ulocal. It has no way of knowing which symbolic
links were followed to get you there, and it is calculating the path
from scratch. It is bound to come up with the canonical path.
Some shells, for example bash, have a builtin pwd. One reason for
doing this is so that the shell can report the name you used to reach
the current working directory. In this case, bash's pwd would report
/usr/local. (In my opinion, this is of dubious utility, but what do I
Barry is (as usual) correct.
Tim Goodwin | "The FSF likes to write programs that require twice as much
Univ of Leicester | memory as your machine has today :-) ." -- Steve Summit