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

variable assignment in a script using globsubst



Any idea why this works from the command line,

$ setopt globsubst
$ files=/bin/c*; echo $files
/bin/cat /bin/chflags /bin/chio /bin/chmod /bin/cp /bin/csh

but in a script, it does not?

# --<script>--
setopt globsubst

files=/etc/c*
echo "$files"
# --</script>--

Output of the script:

/etc/c*

I got the same result on both Linux and BSD.

The script works if I set globassign in the script, but it assigns it
as an array rather than a string.  However, the manual says, this
about globassign.
    "This option is provided for backwards compatibility only"

Am I overlooking some other option that could be affecting it?

-- 
Vincent Stemen
Avoid the VeriSign/Network Solutions domain registration trap!
Read how Network Solutions (NSI) was involved in stealing our domain name.
http://inetaddresses.net/about_NSI.html



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