Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Math assignment to arrays: Is this a bug?
- X-seq: zsh-workers 22665
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Math assignment to arrays: Is this a bug?
- Date: Sun, 03 Sep 2006 10:28:01 -0700
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Try this but be prepared to interrupt it:
x=()
for (( x=1; x <= 10; x++ )) print $x
An infinite stream of "1" is the output.
Put "unset x" between the two lines of the example and it works fine.
Change the example to
x=()
for (( x=1; x <= 10; x++ )) typeset x
and you get an infinite stream of "x=(1)".
Why doesn't the assignment of 1 to x in the loop reset it from array to
scalar?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author