I'm trying to write a helper function in bash that will determine whether a given string is inside a bash array or not. I don't want to flatten the array and pass it in as the LAST argument(s), so it seems like my only choice is to pass in a string containing the name of an array variable.It seems logical that the syntax ${${array_name}[@]} should work in a for loop for iterating over an array indirectly, but that substitution is evidently not allowed.# array_name :: $array -> str -> () * 0|20array::member() {    local array_name    local value    array_name=$1    value=$2    for item in ${${array_name}[@]}; do        [[ $item = $value ]] && return 0    done    return 20}When I try to test this though, bash (latest 3.2.x and latest 4.4.x) complain about the substitution: line 12: ${${array_name}[@]}: bad substitutionDoes bash support looping over an array indirectly without constructing an expression and then calling eval on it?
bash how to loop over contents of an array whose name is stored in a variable
bash