From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4642 invoked by alias); 3 Apr 2012 09:58:01 -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: 16966 Received: (qmail 9448 invoked from network); 3 Apr 2012 09:57:58 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 3 Apr 2012 10:57:48 +0100 From: Peter Stephenson To: Subject: Re: `cd .` in non-existent directory leads into weird corner case Message-ID: <20120403105748.6b16c3aa@pwslap01u.europe.root.pri> In-Reply-To: References: <120327073414.ZM6783@torch.brasslantern.com> <20120402111219.62cbd0c7@pwslap01u.europe.root.pri> <20120402120008.0ed7e583@pwslap01u.europe.root.pri> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.101.10.170] X-Scanned-By: MailControl 7.7.0 (www.mailcontrol.com) on 10.68.0.136 On Mon, 2 Apr 2012 13:10:17 +0200 Mikael Magnusson wrote: > One (semi-)realistic case I came up with, one shell sits in a > directory, someone else first moves the directory, then deletes it, > then the shell tries to 'cd ..'. In this case I would like it to end > up in the new parent directory as it does now [1], not the old > "$PWD:h". (with chasedots/-P) (and even if I did 'cd .' first for some > weird reason). Hmmm... when I read this before I concentrated on "as it does now" and skipped the "not the old $PWD:h". I don't see how that can work. You're saying we should use the physical directory to find its parent even though it doesn't exist any more. Are you saying you think the shell currently has some magic to do this? It seems to violate the laws of physics, unless we recorded the physical directory as a second PWD just on the off chance someone deletes the current one, which seems silly. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog