On 4/18/13 10:40 AM, Greg Wooledge wrote:

>       The order of expansions is: brace expansion, tilde expansion,
>       parameter, variable and arithmetic expansion and command substitution
>       (done in a left-to-right fashion), word splitting, and pathname
>       expansion.
> 
> It's not clear from this part of the documentation how bash handles
> a command substitution nested inside an arithmetic expansion, but you've
> experimentally demonstrated that the nested substitution is performed
> first.

The "Arithmetic Expansion" section says:

All tokens in the expression undergo parameter expansion, string
expansion, command substitution, and quote removal.

This is fairly consistent with what Posix says, but I think I will change
the "string expansion" to something that is used elsewhere in the document.

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

Reply via email to