[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: array subscripts act differently for integers(ie. let)
From: |
Chet Ramey |
Subject: |
Re: array subscripts act differently for integers(ie. let) |
Date: |
Wed, 18 Feb 2015 15:54:36 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 2/18/15 3:49 PM, Maarten Billemont wrote:
> > 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.
What does `bash code' mean? It undergoes the usual set of word expansions.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- array subscripts act differently for integers(ie. let), emanuelczirai, 2015/02/16
- Re: array subscripts act differently for integers(ie. let), Greg Wooledge, 2015/02/16
- Re: array subscripts act differently for integers(ie. let), emanuelczirai, 2015/02/18
- Re: array subscripts act differently for integers(ie. let), Eduardo A . Bustamante López, 2015/02/18
- Re: array subscripts act differently for integers(ie. let), Dan Douglas, 2015/02/18
- Re: array subscripts act differently for integers(ie. let), Chet Ramey, 2015/02/19
- Re: array subscripts act differently for integers(ie. let), Chet Ramey, 2015/02/19
- Re: array subscripts act differently for integers(ie. let), Dan Douglas, 2015/02/20
- Re: array subscripts act differently for integers(ie. let), Chet Ramey, 2015/02/21
Re: array subscripts act differently for integers(ie. let), Eduardo A . Bustamante López, 2015/02/16