Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pushd



"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