Path: csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail From: Stephane Chazelas Newsgroups: gnu.bash.bug Subject: Re: `pwd' returns a dot Date: Wed, 16 Sep 2015 10:46:51 +0100 Lines: 26 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1442410519 12206 208.118.235.17 (16 Sep 2015 13:35:19 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 2.121.107.10 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-Mailman-Approved-At: Wed, 16 Sep 2015 09:35:18 -0400 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11493 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