From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3845 invoked from network); 27 Mar 2008 12:25:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Mar 2008 12:25:58 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 80317 invoked from network); 27 Mar 2008 12:25:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Mar 2008 12:25:53 -0000 Received: (qmail 11459 invoked by alias); 27 Mar 2008 12:25:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24761 Received: (qmail 11446 invoked from network); 27 Mar 2008 12:25:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Mar 2008 12:25:50 -0000 Received: from mail.o2.co.uk (sidious.london.02.net [82.132.130.152]) by bifrost.dotsrc.org (Postfix) with ESMTP id 0B79E82CD267 for ; Thu, 27 Mar 2008 13:25:42 +0100 (CET) Received: from sc.homeunix.net (78.105.216.138) by mail.o2.co.uk (8.0.013.3) (authenticated as stephane.chazelas) id 47D1B89C04BC4115; Thu, 27 Mar 2008 12:25:31 +0000 Received: from chazelas by sc.homeunix.net with local (Exim 4.69) (envelope-from ) id 1JerAh-0002Tr-DO; Thu, 27 Mar 2008 12:25:31 +0000 Date: Thu, 27 Mar 2008 12:25:31 +0000 From: Stephane Chazelas To: Peter Stephenson Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: cd -q (was Re: _canonical_path ...) Message-ID: <20080327122531.GE4740@sc.homeunix.net> Mail-Followup-To: Peter Stephenson , zsh-workers@sunsite.dk References: <080326083638.ZM16858@torch.brasslantern.com> <200803261540.m2QFeJmm017381@news01.csr.com> <200803261604.m2QG41Ke017772@news01.csr.com> <200803261621.m2QGLptV017966@news01.csr.com> <20080326173824.0a55c00d@coredump.raveland.priv> <20080326164615.1d5893ed@news01> <20080327102325.55808716@news01> <20080327120807.415095ee@raveland.org> <20080327112506.7298e9ef@news01> <20080327121525.5b4059f9@news01> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080327121525.5b4059f9@news01> User-Agent: Mutt/1.5.16 (2007-09-19) X-Virus-Scanned: ClamAV 0.91.2/6421/Thu Mar 27 09:54:20 2008 on bifrost X-Virus-Status: Clean On Thu, Mar 27, 2008 at 12:15:25PM +0000, Peter Stephenson wrote: > On Thu, 27 Mar 2008 11:25:06 +0000 > Peter Stephenson wrote: > > I thought unfunction was silent if a function didn't exist, as is now > > true of (and required for) unset, but apparently not. > > +_canonical_paths_pwd() { > > + # Get the canonical directory name by changing to it. > > + # To be run in a subshell. > > + (( ${+functions[chpwd]} )) && unfunction chpwd > > + setopt CHASE_LINKS > > + cd $1 2>/dev/null && pwd > > +} [...] You need cd -- "$1" you might also want cd -P. With "emulate sh", cd -P -- "$1" && pwd -P should return an absolute path. -- Stéphane