From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11501 invoked from network); 19 Dec 2007 10:04:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Dec 2007 10:04:07 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 41434 invoked from network); 19 Dec 2007 10:03:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Dec 2007 10:03:55 -0000 Received: (qmail 18366 invoked by alias); 19 Dec 2007 10:03:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24297 Received: (qmail 18314 invoked from network); 19 Dec 2007 10:03:48 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Dec 2007 10:03:48 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 5FD8A8058F54 for ; Wed, 19 Dec 2007 11:00:36 +0100 (CET) Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Wed, 19 Dec 2007 11:00:36 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly16g.srv.mailcontrol.com (MailControl) with ESMTP id lBJ9xRla024609 for ; Wed, 19 Dec 2007 10:03:36 GMT Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Wed, 19 Dec 2007 09:59:27 +0000 Date: Wed, 19 Dec 2007 09:59:27 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: How to use popd? Message-ID: <20071219095927.12a38736@news01> In-Reply-To: References: Organization: CSR X-Mailer: Claws Mail 3.1.0 (GTK+ 2.10.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 19 Dec 2007 09:59:27.0881 (UTC) FILETIME=[D79F1790:01C84225] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.71.0.126 X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 19 Dec 2007 00:13:13 +0000 (UTC) J=C3=B6rg Sommer wrote: > I've this situation: > % dirs > /usr ~ /tmp ~/Tmp/kernel/linux ~ > % pwd > /usr >=20 > Now I want to go to /tmp. I thought popd +2 is what I need, but I'm still > in /usr. This is documented in the manual. "popd +2" pulls the second item after the head from the stack then changes to the new top. The new top is still /usr. If you are trying to remove /usr and ~ from the stack completely use "repeat 2 popd". If you do this a lot, try rpopd() { repeat $1 popd; } If you're just trying to bring /tmp to the head you need "pushd +2". --=20 Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070