expansion
Bash List names by prefix
Inside double quotes yields matching names as distinct words, not their values.
Formal Syntax & Structure
bash syntaxbash
${!prefix@}Return Value
shell expansion result
Inside double quotes yields matching names as distinct words, not their values.
Working Example
Example Snippetbash
BM6_A=oneBM6_B=twoprintf '[%s]\n' "${!BM6_@}"