bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: array subscripts act differently for integers(ie. let)


From: Maarten Billemont
Subject: Re: array subscripts act differently for integers(ie. let)
Date: Wed, 18 Feb 2015 15:49:18 -0500

> also this variant does the same:
> $ (('ar[$idbad2]+=11'))
 

Because (( and let are essentially equivalent.

I think the more important question isn't "why does (( behave this way?", but rather "should (( behave this way?".

It's probably not reasonable to expect the author to know and take into account that (( arr[$key] )) treats key's data as bash code.  Really, the behaviour of ((' arr[$key] ')) makes more sense as a default behaviour.  The former is broken (as the expectation that $key expands data is not met).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]