Hi, please consider the following script:

```
declare -ar indexed_array=(1 2 3)
declare -ar indexed_array_null=()

declare -Ar associative_array=(\
["apple"]="1" \
["banana"]="2" \
)
declare -Ar associative_array_null=()

for parameter in indexed_array indexed_array_null associative_array
associative_array_null; do
declare -n array_nameref="${parameter}"

if [ ! -v array_nameref ]; then
printf "%s is NOT set\n" "${parameter}"
else
printf "%s is set\n" "${parameter}"
fi

unset -n array_nameref
done
```

Reply via email to