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

Re: Simple Question.....I think?

DPD writes:
> dpdhost:ttyp2:domenick:~% ls -dl /usr1/src/zsh*

/usr1/src/zsh* is replaced with /usr1/src/zsh-3.0.0/ /usr1/src/zsh-3.0.0.log
So this is equivalent to:
ls -dl /usr1/src/zsh-3.0.0/ /usr1/src/zsh-3.0.0.log

> drwxrwxr-x   9 root     sysop        1024 Oct 15 16:21 /usr1/src/zsh-3.0.0/
> -rw-------   1 root     root         2637 Oct 15 15:48 /usr1/src/zsh-3.0.0.log
> dpdhost:ttyp2:domenick:~%
> dpdhost:ttyp2:domenick:~% cd /usr1/src/zsh*

Equivalent to: cd /usr1/src/zsh-3.0.0/ /usr1/src/zsh-3.0.0.log
(The fact that the command is cd has no special effect.)

> cd: string not in pwd: /usr1/src/zsh-3.0.0
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is normal. Look at the man: this is the second form of cd.

> What does this mean???  Should I be able to successfully cd to 
> '...zsh-3.0.0' the way other shells, like the bash shell at least, 
> could??  If so, what option/variable/flag/etc needs to be set??

You should type: cd /usr1/src/zsh*(/)

or better: cd /usr1/src/zsh*(-/)
if you want the symbolic links to be taken into account.

I don't think there is an option so that cd does a cd on the first
argument that is a directory. But you can write a zsh function cd
that behaves like this.

> PS:  Yes I am actively searching through the zsh documentation for 
> answers!!!!!!!!

In the man, look at:
  _ the man of cd, in zshbuiltins;
  _ filename generation (globbing), in zshexpn.


Vincent Lefevre, vlefevre@xxxxxxxxxxx | Acorn RiscPC600, 20+1MB RAM, Eagle M2
http://www.ens-lyon.fr/~vlefevre      | Apple CD-300, SyQuest 270MB
PhD in Computer Science, 1st year     | Atari Falcon030, 4MB RAM

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