bug-bash
[Top][All Lists]
Advanced

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

Re: bash does filename expansion when assigning to array member in compo


From: Chet Ramey
Subject: Re: bash does filename expansion when assigning to array member in compound form
Date: Fri, 24 Aug 2012 09:38:44 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0

On 8/22/12 8:58 PM, Chet Ramey wrote:

> Then how about this: words inside a compound assignment statement that are
> recognized as assignment statements ([1]=foo) are expanded like assignment
> statements (no brace expansion, globbing, or word splitting).  Other words
> undergo all the expansions.
> 
> That means you can do things like
> 
> [{0,1,2,3}]=foo
> 
> to set the first four elements to the same value

Or should these be marked as assignment statements after brace expansion,
with the appropriate expansions performed?  It can be complicated to
suppress brace expansion on the RHS after allowing it on the LHS.

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]