Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Inconsistency of GLOB_ASSIGN
- X-seq: zsh-workers 33806
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Inconsistency of GLOB_ASSIGN
- Date: Wed, 26 Nov 2014 21:57:25 -0800
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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