Use wildcard expansion to echo all variables in zsh
问题 With multiple variables beginning with the same pattern can a wildcard be used to echo all matched patterns? when zzz1=test1; zzz_A=test2; zzza=test3 What is the best way to match all variables starting with zzz. Where something like echo $zzz* or for i in $zzz*; do echo $i; done would output: test1 test2 test3 回答1: So to directly answer based on comments above... No, zsh cannot expand and echo variables using a wildcard, but typeset can provide the desired result. typeset -m 'zzz*' outputs: