Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh 3.0.1 bug with named directories?
- X-seq: zsh-workers 2380
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: rft@xxxxxxxxxxxxxxx
- Subject: Re: zsh 3.0.1 bug with named directories?
- Date: Tue, 12 Nov 1996 21:43:50 +0100 (MET)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <9611122023.AA25067@xxxxxxxxxxxxxxxxxxxxx> from Robert F Tobler at "Nov 12, 96 09:23:51 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
Robert F Tobler wrote:
[...]
> namedir () { eval '$1=$2 ; if [[ ! -d ~$1 ]]; then unset $1 ; fi' }
[...]
> Now if I do the same in zsh 3.0.1, I get the following message:
>
> ray% namedir projects /usr/local/projects
> zsh: no such file or directory: projects=/usr/local/projects
> zsh: no such user or named directory: projects
>
> Due to this and another problem (which I will post seperately) I have not
> installed zsh 3.0.1 yet.
Replace the single quotes with double quotes above and it'll work. It
seems that you original intention was to eval the expanded string but
strings within single quotes are not expanded. In zsh-3.0.0
$1=$2 worked as an assignemt but it was a bug and it does not work
anymore.
E.g. this should work:
namedir () { eval $1=\$2 ; if [[ ! -d ~$1 ]]; then unset $1 ; fi }
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author