bug-bash
[Top][All Lists]
Advanced

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

Assignments preceding "declare" affect brace and pathname expansion.


From: Dan Douglas
Subject: Assignments preceding "declare" affect brace and pathname expansion.
Date: Mon, 25 Mar 2013 20:44:06 -0500
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

Hi,

    $ set -x; foo=bar declare arr=( {1..10} )
    + foo=bar
    + declare 'a=(1)' 'a=(2)' 'a=(3)' 'a=(4)' 'a=(5)'
 
    $ touch xy=foo
    $ declare x[y]=*
    + declare 'x[y]=*'
    $ foo=bar declare x[y]=*
    + foo=bar
    + declare xy=foo

This isn't the same bug as the earlier a=([n]=*) issue. Each word (the entire
assignment) is subject to globbing. "let", "eval", and possibly other builtins
appear to randomly use this same kind of expansion regardless of whether they 
are preceded by an assignment, though I can't think of any uses for it. 
Arguments in this case are treated neither as ordinary assignments
nor ordinary expansions.

-- 
Dan Douglas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]