my code
TOTAL=${#FOO_5[*]} // COUNT ITEMS IN ARRAY
what if code
ARRAY_NAME="FOO_5"
TOTAL=${#${!ARRAY_NAME}[*]} //error
please fix
When it comes to indirect parameter expansion, the array index is considered part of the parameter name. Unfortunately, you cannot chain parameter expansions; you'll also need a intermediate variable.
ARRAY_NAME="FOO_5[*]"
FULL=${!ARRAY_NAME}
TOTAL=${#FULL}
"${#a[*]}" and "${#a[@]}" are equivalent, so this is probably not what he wants. full=("${!arr}") total=${#full[@]}. I'd just eval.