Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to use popd?
- X-seq: zsh-workers 24297
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: How to use popd?
- Date: Wed, 19 Dec 2007 09:59:27 +0000
- In-reply-to: <slrnfmgogp.23b.joerg@xxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <slrnfmgogp.23b.joerg@xxxxxxxxxxxx>
On Wed, 19 Dec 2007 00:13:13 +0000 (UTC)
Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
> I've this situation:
> % dirs
> /usr ~ /tmp ~/Tmp/kernel/linux ~
> % pwd
> /usr
>
> 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".
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author