On 7/21/13 10:35 PM, Dan Douglas wrote:
> What's the bug? I can't reproduce this and always get "xx" no mater the
> option
> order.
>
> I always assumed the -i attribute doesn't get set until after assigning the
> values, which is why:
>
> $ ( declare -ia foo=(1 2 xx 3); echo "${foo[@]}"
$ bash -xc 'declare -i a=(1 x 3)'
+ a=(1 x 3)
+ declare -i a
$ bash -xc 'declare -i a=x'
+ declare -i a=x
That is how bash treats it, and the reason they differ. There are some useful
properties to this. Remember arithmetic gets recursive evaluation in Bash so
"x" is still going to end up eval
Dan Douglas wrote:
> On Sunday, July 21, 2013 08:39:29 PM Linda Walsh wrote:
>> I don't think so. Not from the above.
>>
>> The first sets up an array outside the function composed of integers,
>> so the 2nd time I execute the same, it gets put through the "integer
>> strainer".
>>
>> The bug