bug-bash
[Top][All Lists]
Advanced

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

Re: Problem with array initialization in typeset.


From: Chet Ramey
Subject: Re: Problem with array initialization in typeset.
Date: Wed, 29 Jun 2005 09:33:36 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

Steven W. Orr wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: linux-gnu
> Compiler: i386-redhat-linux-gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
> -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
> -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -D_FILE_OFFSET_BITS=64 
> -O2 -g -pipe -m32 -march=i386 -mtune=pentium4
> uname output: Linux saturn 2.6.10-1.770_FC3smp #1 SMP Thu Feb 24 14:20:06 EST 
> 2005 i686 athlon i386 GNU/Linux
> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 3.0
> Patch Level: 14
> Release Status: release
> 
> Description:
>       Array initialization seems to be broken from typeset

The problem is actually double evaluation.  In versions of bash through
3.0, the assignment statement ends up being expanded twice:  once before
typeset is called, and once by the array assignment code.

This has been fixed for the next version of bash, and things work as you
expect.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@case.edu    http://tiswww.tis.case.edu/~chet/




reply via email to

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