From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27786 invoked by alias); 3 Apr 2012 14:43:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16973 Received: (qmail 19567 invoked from network); 3 Apr 2012 14:43:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Tue, 3 Apr 2012 16:43:27 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: `cd .` in non-existent directory leads into weird corner case Message-ID: <20120403144327.GA16032@xvii.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <120327073414.ZM6783@torch.brasslantern.com> <669DD9CA-3987-4D27-B9C6-474B32B95A32@kba.biglobe.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <669DD9CA-3987-4D27-B9C6-474B32B95A32@kba.biglobe.ne.jp> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6201-vl-r48020 (2011-12-20) On 2012-04-03 13:04:52 +0900, Jun T. wrote: > Once pwd is set to '.', $PWD has different value than pwd. > Is this intensional? Not only in this case. mkdir -p tmpdir1/tmpdir2 cd tmpdir1/tmpdir2 pwd echo "$PWD" mv ../../tmpdir1 ../../tmpdir3 pwd echo "$PWD" cd ../.. rm -r tmpdir3 gives: /tmp/tmpdir1/tmpdir2 /tmp/tmpdir1/tmpdir2 /tmp/tmpdir3/tmpdir2 /tmp/tmpdir1/tmpdir2 pdksh, mksh and posh behave like zsh, but dash, bash and ksh93 output /tmp/tmpdir1/tmpdir2 every time. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)