On 1/5/18 2:05 PM, Tim Burnham wrote:

> 
> Why does the parser inconsistently detect the identifier `${var2}'? In
> the 3rd line of my example, Bash assigns the given expression into
> `${var3}' as intended.

The parser is consistent. It doesn't mark that word as a valid assignment
statement, either, which has implications for how it's expanded (for
example, it undergoes word splitting). That word doesn't contain any
metacharacters, so it's not a syntax error.  It just appears as an argument
to `declare', which knows how to deal with it.

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