On Tue, Feb 23, 2021 at 12:17:10PM +0100, Alex fxmbsw7 Ratchev wrote: > what, sorry, mailing stuff isnt much clear to me, ... its not possible to > have a var=\'\] ; assoc[$var] ?
It should work for simple assignment and retrieval. You need to add quotes for [[ -v 'assoc[$var]' ]] to work, and math contexts are dodgy as hell. No amount of quoting will make (( 'assoc[$var]'++ )) work. If you want to increment the value of this array element, you'll need to retrieve it into a temporary string variable, increment that, and then copy it back into the array.