bug-bash
[Top][All Lists]
Advanced

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

incorrect associative array key parsing if they contain closing square b


From: Rich
Subject: incorrect associative array key parsing if they contain closing square bracket
Date: Mon, 02 May 2011 16:14:39 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.5.0

associative array key parsing seems to be incorrect if they contain closing square bracket inside the array=([key]=value) construct.

the following testcase :

$ declare -A key_full; key_full=(["version[agent]"]=agent.version); echo "${!key_full[@]}"
-------------------
results per version.

---- 4.0.33(1)-release (shbot in #bash) :

<shbot> Richlv: version\[agent\]

---- 4.1.7(1)-release :

-bash: declare: key_full: cannot convert indexed to associative array
0

---- 4.1.10(1)-release :

bash: declare: key_full: cannot convert indexed to associative array
0

---- 4.1.10(2)-release :

bash: [version[agent]]=agent.version: bad array subscript

----
according to people in #bash :

<sn18> i get bad array subscript with 4.2
<pgas> it fails in 4.2.8
--
 Rich



reply via email to

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