$ cd /usr/X11 $ pwd /usr/X11 $ /bin/pwd /usr/X11R6 $ ls -ld /usr/X11 lrwxrwxrwx 1 root root 5 Oct 21 1999 /usr/X11 -> X11R6But I see what you are saying in the case of the current directory being a deleted directory, eg :-
$ mkdir test cd test pwd ; /bin/pwd /home/ncw/test /home/ncw/test rmdir . $ pwd ; /bin/pwd /home/ncw/test /bin/pwd: cannot get current directory: No such file or directoryAnyway, getcwd() was what I expected Cwd to use, and I was very suprised to see this /bin/pwd thing!
Thanks for the explanation. I think from the above experinents /bin/pwd == getcwd() under linux, so on that platform at least it should be replaced with getcwd(). According to my man pages getcwd() is POSIX so pretty much any unix should support it now-a-days.