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

Re: Bug in "dirs a b c" where a b c are relative paths?



On Nov 1, 10:06pm, Jerry Peek wrote:
} Subject: Bug in "dirs a b c" where a b c are relative paths?
}
} When "dirs a b c d e" puts directories on the stack, should it convert
} any relative pathnames to absolute?  Or does the manpage need a warning?

If anything, it's a documentation problem.  `dirs a b c d e' is just like
assigning to a parameter; it doesn't actually change directories to each
of the argument directories.  The man page says only, "If arguments are
specified, load them onto the directory stack, replacing anything that was
there, and push the current directory onto the stack."  It doesn't say
anything about interpreting the arguments (which pushd and cd do at some
length).

A corresponding interesting manual omission is that cdpath is followed at
popd time (and stack-cycling time with pushd), so actually if you did:

	cdpath=($PWD)
	dirs a b c d e

You could then us `popd' to change to each of the stacked directories just
as if they'd been made relative to $PWD by `dirs'.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author