[Top][All Lists]

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

Re: declare a=( {1..10} )

From: Chet Ramey
Subject: Re: declare a=( {1..10} )
Date: Thu, 09 Jul 2009 21:05:37 -0400
User-agent: Thunderbird (Macintosh/20090605)

agriffis@n01se.net wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i486
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2 
> -Wall
> uname output: Linux oliva 2.6.28-1-amd64 #1 SMP Mon Feb 23 04:56:40 UTC 2009 
> i686 GNU/Linux
> Machine Type: i486-pc-linux-gnu
> Bash Version: 4.0
> Patch Level: 24
> Release Status: release
> Description:
>       Array assignment with declare produces unexpected results.

This is one of the differences between assignment statements, which are
separated out and processed separately by the word expansion code, and
words that look like assignment statements that are arguments to builtins
(like declare) that accept assignment statements.

Bash does its best to treat the two identically, but brace expansion
happens very early in the expansion process.  I will see whether or
not I can defer brace expansion on assignment statement arguments.


``The lyf so short, the craft so long to lerne.'' - Chaucer

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]