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: Chet Ramey
Subject: Re: array subscripts act differently for integers(ie. let)
Date: Thu, 19 Feb 2015 20:47:41 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2/18/15 4:14 PM, emanuelczirai@cryptolab.net wrote:
> tl;dr: thanks! no reply needed;
> 
> Thanks guys. I had a hard time accepting that this is how it's supposed to
> work.
> I accepted it now. :)

Yeah.  The expression between (( and )) is word expanded, since (( ... ))
is supposed to be exactly equivalent to let "...".

The real issue is that assignment statements in arithmetic expressions
that contain array references are also word expanded, almost as if they
were executed in an assignment statement context.  This is how bash has
always behaved, though; backwards compatibility is a concern.

Chet

-- 
``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/



reply via email to

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