On Fri, Dec 31, 2010 at 11:56 AM, <dnade....@orange-ftgroup.com> wrote:
> Ha. Indeed, if i use declare –A, it works. > > > > But why is bash letting me use foo[bar]=something in the first place, if I > don’t declare foo as an associative array ? > > Maybe the bug’s here. > > > > D > > > It's because [ ] is an arithmetic context. In an arithmetic context the content of the variable is evaluated, and a null string is evaluated to 0, just like when you do echo $((var))