2021年8月19日(木) 19:37 Léa Gris <lea.g...@noiraude.net>: > Current implementation of @K is pretty-much useless for the dialog use-case: > > > #!/usr/bin/env bash > > > > declare -A assoc=( > > [P]=piano > > [TB]='foldable table' > > ['CH AIR']=chair > > ) > > > > options=("${assoc[@]@K}")
I this particular case, you can instead write declare -a "options=(${assoc[@]@K})" though I agree that the behavior of zsh's ${(kv)assoc} (i.e., expanding to separate words) is more useful. It's too late to change the behavior of @K so maybe the new behavior can be assigned to @k if it is worth implementing in Bash. -- Koichi