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

Named directory pointing to a symbolic link



Hi zusers,

I've run into a behaviour I wasn't expecting with named directories on
FreeBSD. It's not like its a real inconvenience, but I thought I'd ask
anyway because I didn't find anything about this in the manual.

It seems to me like the 'www' variable (which ought to be unset when I
start the shell, it's not like it should be a special variable as far
as I understand) has a strange behaviour : it points on /nonexistent
when used as a named directory, and any attempt I do to have it point
elsewhere with the export builtin doesn't work when the variable is
used as a named directory, though it works when invoked as hash -d.
Other variable names don't seem to behave that way.

The script you see below is executed on a machine on which I installed
zsh in my user account, but I don't think it could be relevant because
I can reproduce it on another FreeBSD where zsh is installed the
vanilla way and where I don't have any configuration files. This
doesn't happen on the linux box I have my hands on at the moment,
where the www variable behaves exactly the same way as the foo
variable. It happens that I can't test on other systems I usually have
access to at the moment, sorry :/

To clarify what I mean :

> zsh/bin/zsh -f
mobdev% zsh/bin/zsh --version
zsh 4.2.5 (i386-unknown-freebsd4.11)
mobdev% uname -a
FreeBSD mobdev 4.11-STABLE FreeBSD 4.11-STABLE #1: Tue Feb 22 05:55:23 JST 2005
    root@:/usr/src/sys/compile/WDB  i386
mobdev% autoload -U parameters
mobdev% echo $nameddirs

mobdev% echo ~foo
zsh: no such user or named directory: foo
mobdev% echo $www

mobdev% echo ~www
/nonexistent
mobdev% export www=/usr
mobdev% echo $www
/usr
mobdev% echo ~www
/nonexistent
mobdev% hash -d www=/usr
mobdev% echo $www
/usr
mobdev% echo ~www
/usr
mobdev%

Does anyone have an idea of why this variable behaves that way ?

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya


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