help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] declare -i


From: Chet Ramey
Subject: Re: [Help-bash] declare -i
Date: Thu, 10 May 2012 10:22:24 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 5/10/12 9:56 AM, Greg Wooledge wrote:
> On Thu, May 10, 2012 at 09:52:45AM -0400, Chet Ramey wrote:
>> Where does the man page say it's ok to use negative subscripts when
>> assigning arrays?
> 
> Second paragraph of "Arrays":
> 
>       An indexed array is created automatically if any variable is assigned
>       to using the syntax name[subscript]=value.  The subscript is treated
>       as an arithmetic expression that must evaluate to a number.  If
>       subscript evaluates to a number less than zero, it is used as an
>       offset from one greater than the array's maximum index (so a subcript
>       of -1 refers to the last element of the array).

OK, I can see that.  The intent, however, is to refer to referencing
arrays.  That threw me for a minute because the sentence in question does
not appear in the current version of the manual page, which has moved it,
slightly modified, to the paragraph describing referencing arrays.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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