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
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
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
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.
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,
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE