On 1/25/18 3:45 PM, Chet Ramey wrote:

> These two commands are basically equivalent. By the time the expression
> evaluation is performed, the expression has undergone word expansion,
> and the expression is "A[ ]++" or "A[ ]=1", respectively. Bash doesn't
> allow blank array subscripts, and when the expression evaluator tries to
> get the value of "A[ ]", it's not seen as a valid array reference.
> 
> (It should display an error message if it's not going to allow it, though.)

The alternative, of course, is to simply allow subscripts consisting only
of whitespace: they would evaluate to 0 in an arithmetic context and as
a string when subscripting associative arrays. I'll look at this.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to