2015-09-16 15:51:08 +0800, ziyunfei: > $ cd / > $ PWD=. bash -c pwd > . > $ PWD=. ksh -c pwd > / > > Posix says that pwd shouldn't return the filenames dot or dot-dot. > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html
Also: $ cd / $ PWD=bin/.. bash -c 'pwd; cd ..; pwd' bin/.. .. Note that POSIX is now explicit in how $PWD from the environment should be handled: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03 -- Stephane