bug-bash
[Top][All Lists]
Advanced

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

Re: declare a="$b" if $a previously set as array


From: Chet Ramey
Subject: Re: declare a="$b" if $a previously set as array
Date: Tue, 16 Dec 2014 10:51:36 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 12/16/14, 2:53 AM, Dan Douglas wrote:
> On Sunday, December 14, 2014 02:39:29 PM Chet Ramey wrote:
>> And we get to the fundamental issue.  Is it appropriate to require
>> arguments to declaration commands to be valid assignment statements when
>> the parser sees them, instead of when the builtin sees them, at least
>> when using the compound assignment syntax.
>>
>> I'm ok with tightening the rules and saying that it is, but it's not
>> backwards compatible and changes the behavior of things like
>>
>> declare -a foo='(1 2 3)'
>>
>> which I imagine plenty of people have used and has been a supported way
>> to do compound assignment for many years.
> 
> That would be one way but I think this can be solved without going quite
> so far. How do you feel about these rules?

For context, these are the current semantics that bash attempts to
implement.  This change is slated for the next release of the standard
(issue 8).

http://austingroupbugs.net/view.php?id=351

This introduces the concept of a `declaration utility' and specifies
their behavior with respect to assignment statements as arguments.
In bash, declare, typeset, local, export, and readonly are all
declaration commands.
-- 
``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]