Le 23/02/2021 à 12:17, Alex fxmbsw7 Ratchev écrivait :
what, sorry, mailing stuff isnt much clear to me, ... its not possible to have a var=\'\] ; assoc[$var] ?
You can if assoc is declared an associative array before:
$ (LANG=C; unset var assoc; var=\'\]; assoc[$var]=hello; typeset -p assoc) bash: ']: syntax error: operand expected (error token is "']")
but:
$ (LANG=C; unset var assoc; var=\'\]; declare -A assoc; assoc[$var]=hello; typeset -p assoc) declare -A assoc=(["']"]="hello" )
-- Léa Gris