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

Re: variable assignment in a script using globsubst

On Wed, May 18, 2005 at 06:49:25PM +0100, Peter Stephenson wrote:
> Vincent Stemen wrote:
> > No, I "unsetopt globassign" to make sure, even though it did not show
> > in the list of currently set options, but it still works from the
> > command line.  I was trying to do it this way because the script I am
> > working on is running in sh emulation mode and doing it as
> > "files=/bin/c*" assigns it as a single string.  I ended up going ahead
> > and changing the one function to zsh mode and doing it as a list to
> > get around the problem, but I wonder if I have stumbled onto a bug
> > here.
> Do you have globsubst set?  In that case, files will be set to /bin/c*
> but "echo $files" would expand the glob at that point.

Yes.  That is what was happening.  I was thinking globsubst would
cause it to expand even on a variable assignment.  You are right, the
expansion was taking place in my echo statement when I did not have
quotes around $files.  Ok.  I guess I need to stick to doing it as a
list in zsh emulation mode.

Thank you for clarifying that.

Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
Read how Network Solutions (NSI) was involved in stealing our domain name.

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