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

Inconsistency of GLOB_ASSIGN



Consider:

torch% print C*
Config
torch% print c*
config.h config.log config.modules config.modules.sh config.status
torch% setopt GLOB_ASSIGN
torch% integer x
torch% x=C*
torch% typeset -p x
typeset -i x=0
torch% x=c*
torch% typeset -p x
typeset -a x
x=(config.h config.log config.modules config.modules.sh config.status)
torch% 

Shouldn't the glob assignment to x have turned it into an array, or at
least into a non-integer scalar, even though there was only one match?

Yes, I know the reason is that "Config" got expanded first and then taken
as a variable name in arithmetic evaluation, therefore defaulting to the
value 0 which was assigned to x.  Still, the following seems wrong to me:

torch% integer x
torch% typeset -p x
typeset -i x=0
torch% x=*.h
zsh: bad floating point constant



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