From the man page:
> When used in a function, declare makes each name local, as with the `local` command, unless the `-g` option is used.
Example:
FUNCtst() {
declare -gA astr
astr=([a]="1k" [b]="2k" )
declare -p astr
}
FUNCtst
declare -p astr
prints
declare -A astr=([a]="1k" [b]="2k" )
declare -A astr=([a]="1k" [b]="2k" )