On Fri, Apr 2, 2021 at 2:56 AM Chet Ramey <chet.ra...@case.edu> wrote: > > On 4/1/21 2:55 PM, konsolebox wrote: > > > So to keep compatibility, would this be the right way? > > > > if [[ BASH_VERSINFO -ge 6 || BASH_VERSINFO -eq 5 && BASH_VERSINFO -ge 2 ]]; > > then > > unset() { > > set -- "${@//\[/\\[}" > > set -- "${@//\]/\\]}" > > eval builtin unset "$@" > > } > > fi > > To do what, exactly?
To keep this working in both behaviors. declare -A a key='$(echo foo)' a[$key]=1 unset 'a["$key"]' declare -p a # declare -A a=() -- konsolebox