Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pushd
- X-seq: zsh-workers 2230
- From: Peter Stephenson <pws@xxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: pushd
- Date: Tue, 15 Oct 1996 14:45:35 +0200
- In-reply-to: ""Bart Schaefer""'s message of "Fri, 11 Oct 1996 12:53:54 MET." <961011125354.ZM10006@xxxxxxxxxxxxxxxxxxxxxxx>
"Bart Schaefer" wrote:
> Is the following more like the behavior you want?
Well, if I adapt your suggestion to:
pushd () {
setopt localoptions globsubst
unsetopt ksharrays
case $1 in
+*) setopt pushdignoredups
builtin pushd ${${=$(dirs)}[$1+1]};;
-*) setopt pushdignoredups
builtin pushd ${${=$(dirs)}[$1-1]};;
*) builtin pushd $*;;
esac
}
(since I need ~ expansion and I don't want to count entry 0 from dirs
in the array indexing) I seem to get basically what I want. It's yet
another case of running very hard to stay in the same place.
--
Peter Stephenson <pws@xxxxxx> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author