Re: Single quote character not handled well in associative array index

2016-12-15 Thread Chet Ramey
On 8/29/16 5:57 PM, Jarno Suni wrote: > Bash Version: 4.3 > Patch Level: 46 > Release Status: release > > Description: > Using associative array variable that has a single quote in index does > not work withing (( )) without a trick. I'm working on a shell option that will make this work closer

Re: Single quote character not handled well in associative array index

2016-09-18 Thread Chet Ramey
On 8/29/16 11:28 PM, Wesley Hirsch wrote: > Actually, that raises an interesting question about the differences between > $(( and ((. The man page says that $(( treats its contents as double > quoted, however, (( is a built-in an not an expansion. How does (( treat > its contents? The `((' comm

Re: Single quote character not handled well in associative array index

2016-08-31 Thread Chet Ramey
On 8/29/16 5:57 PM, Jarno Suni wrote: > Bash Version: 4.3 > Patch Level: 46 > Release Status: release > > Description: > Using associative array variable that has a single quote in index does > not work withing (( )) without a trick. Yes, this is a problem resulting from the subscript being scan

Re: Single quote character not handled well in associative array index

2016-08-30 Thread Greg Wooledge
On Mon, Aug 29, 2016 at 11:28:47PM -0400, Wesley Hirsch wrote: > ((++a[\$b])) These three also work: (('++a[$b]')) (('++a["$b"]')) : $((++a["$b"])) But yes, this does seem like a bug.

Re: Single quote character not handled well in associative array index

2016-08-30 Thread Wesley Hirsch
On Mon, Aug 29, 2016 at 5:57 PM, Jarno Suni wrote: > declare -A a > b="80's" > ((++a[$b])) > ((++a["$b"])) > [[ $((++a[$b])) ]] || true > [[ $((++a["$b"])) ]] || true # this finally works and makes the variable > =1 > echo ${a["$b"]} > echo ${a[$b]} > ((++a[\$b])) It's non-intuitive certainly,