zsh-workers
 help / color / mirror / code / Atom feed
* zsh 3.0.1 bug with named directories?
@ 1996-11-12 20:23 Robert F Tobler
  1996-11-12 20:43 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Robert F Tobler @ 1996-11-12 20:23 UTC (permalink / raw)
  To: zsh-workers


I have been using the facility of zsh-3.0.0 to name directories by using a  
variable assignment:

	projects=/usr/local/projects

when I first introduced a number of these names in my .zshrc, they would not  
be considerd for completion with ~name before changing to this directory for  
the first time.  For this reason I set up the following function:

	namedir () { eval '$1=$2 ; if [[ ! -d ~$1 ]]; then unset $1 ; fi' }

and afterwards I could do:

	namedir projects /usr/local/projects
	namedir toolkits /usr/local/toolkits

and these names would then be considered for completion (forced by the d-)  
using ~projects or ~toolkits.

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.

This is on a i386-next-nextstep3 machine, zsh compiled with gcc 2.7.2.1.

rft

------------------------------------------------------------------------
  Robert F. Tobler                 -  tel:+43(1)58801-4585,fax:5874932
  Institute of Computer Graphics   -  mailto:rft@cg.tuwien.ac.at
  Vienna University of Technology  -  http://www.cg.tuwien.ac.at/~rft/



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

* Re: zsh 3.0.1 bug with named directories?
  1996-11-12 20:23 zsh 3.0.1 bug with named directories? Robert F Tobler
@ 1996-11-12 20:43 ` Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-11-12 20:43 UTC (permalink / raw)
  To: rft; +Cc: zsh-workers

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


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

end of thread, other threads:[~1996-11-12 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-12 20:23 zsh 3.0.1 bug with named directories? Robert F Tobler
1996-11-12 20:43 ` Zoltan Hidvegi

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).