No bug here, but I naively expected the pattern substitution expansion to work on array keys as well as values, e.g.:
$ declare -A h $ h[foo]=x h[bar]=y $ # show keys and values: $ printf "\t<%s>\n" "${!h[@]}" "${h[@]}" <bar> <foo> <y> <x> $ # try to pad keys and values: $ printf "\t<%s>\n" "${!h[@]/#/ }" "${h[@]/#/ }" <> < y> < x> I wanted to print out array keys with some padding, easily done in a loop, but I wanted the padding applied to the separate strings generated using the quoted [@] expansion. The manpage documents the ${!name[@]} 'List of arrays keys' expansion separately from the pattern substitution expansion, so it's all working as documented, but I think the syntax could allow this. I'm not running the latest bash: $ bash --version GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu) Ken