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

Re: zsh 3.0.1 bug with named directories?



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