[Top][All Lists]

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

declare -ag with assignment bug

From: Joseph Graham
Subject: declare -ag with assignment bug
Date: Thu, 26 Apr 2012 21:50:39 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Configuration Information [Automatically generated, do not change]:
Machine: mips64el
OS: linux-gnu
Compiler: mips64el-unknown-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='mips64el' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='mips64el-unknown-linux-gnu' 
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -O2 -march=loongson2f 
-mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop -fstack-protector 
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 
-DSYS_BASHRC='/etc/bash.bashrc' -DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
uname output: Linux yeeloong.t67.eu 3.3.0-1-LIBRE #1 PREEMPT Mon Apr 2 18:49:26 
UTC 2012 mips64 ICT Loongson-2 V0.3 FPU V0.1 lemote-yeeloong-2f-8.9inches 
Machine Type: mips64el-unknown-linux-gnu

Bash Version: 4.2
Patch Level: 24
Release Status: release

Arrays defined in a function with declare -ag are not
available outside the function if an assignment is done with the
declaration, though it works if the assignment is done seperately from
the declaration.

$ f() { declare -ag a=(my array); }; f; declare -p a
declare -a a='()'
$ f() { declare -ag a; a=(my array); }; f; declare -p a
declare -a a='([0]="my" [1]="array")'

reply via email to

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