zsh-users
 help / color / mirror / code / Atom feed
* Bug in "dirs a b c" where a b c are relative paths?
@ 2000-11-02  5:06 Jerry Peek
  2000-11-02 16:43 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Jerry Peek @ 2000-11-02  5:06 UTC (permalink / raw)
  To: zsh-users

Hi, all.  I did a quick search and didn't find this potential 3.0.7
bug mentioned in change lists... I hope this isn't a repeat.  It
seems familiar somehow.  Anyway, here goes:

I'm still working on the third edition of O'Reilly's "Unix Power Tools"
...and still rummaging around the zsh manpages for tidbits that fit.
In one of the articles about directory stacks, in the section on
clearing the stack, I was playing with the zsh command "dirs a b c d".
It replaces the stack contents with the directories a b c and d.
I think this has trouble when the directory pathnames are relative
(don't start with a /).

For example, I made five subdirectories in /tmp named a b c d and e.
Then I added them all to the stack.  Watch what happened:

	zsh% pwd 
	/tmp
	zsh% ls -Fd ?
	a/  b/  c/  d/  e/
	zsh% dirs ?
	zsh% dirs
	/tmp a b c d e
	zsh% pushd +2
	/tmp/b c d e /tmp a
	zsh% pushd +2
	pushd: no such file or directory: d

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?

Jerry
-- 
Jerry Peek, web@jpeek.com, http://www.jpeek.com/


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in "dirs a b c" where a b c are relative paths?
  2000-11-02  5:06 Bug in "dirs a b c" where a b c are relative paths? Jerry Peek
@ 2000-11-02 16:43 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-11-02 16:43 UTC (permalink / raw)
  To: Jerry Peek, zsh-users

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   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-11-02 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-02  5:06 Bug in "dirs a b c" where a b c are relative paths? Jerry Peek
2000-11-02 16:43 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).