[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `pwd' returns a dot
From: |
Stephane Chazelas |
Subject: |
Re: `pwd' returns a dot |
Date: |
Wed, 16 Sep 2015 10:46:51 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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