bug-bash
[Top][All Lists]
Advanced

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

Re: Assignments preceding "declare" affect brace and pathname expansion.


From: Chet Ramey
Subject: Re: Assignments preceding "declare" affect brace and pathname expansion.
Date: Mon, 01 Apr 2013 20:40:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

On 3/28/13 1:05 AM, Dan Douglas wrote:
> On Tuesday, March 26, 2013 08:33:52 PM Chet Ramey wrote:
> 
> Thank you. I'm familiar with the declaration commands. It's issue 7, not TC1.

Actually, I don't think it's either.  I think we're going to have to wait
until issue 8 for these.

> Are you saying here that even when a declaration command is _not_ identified, 
> that it's still correct for word expansions to not follow the usual rules for 
> regular non-declaration commands?
> 
> Hopefully my examples were clear. What I don't understand is this:
> 
>    # This is correctly recognized
>  $ touch 'a=( x )'
>  $ declare a=( * )
>  $ echo "$a"
>  a=( x )
> 
>    # This should either be like above, or fail as below.
>  $ _= declare a=( * )
>  $ echo "$a"
>  ( x )

I see the problem.  The parser handles assignment statements preceding a
command word, and marks assignments following declaration commands as
assignment statements requiring special handling.  The word expansion code,
possibly making assumptions about when in the expansion process it will be
called, does not.  I will change this for 4.3-beta so the two are consistent.

Chet

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