$ declare -A x=([a]=10); [[ -v x ]]; echo $?
1
-v can not test if a hash is declared.
`declare -p x 2> /dev/null` can not tell whether it is a hash or a variable.
What is the best way to check if a variable exists and is a hash? Thanks.
--
Regards,
Peng