Cant access hash array value assigned in a for loop outside of it.
declare -A numbers
for((i=0;i<5;i++)){
randNum=$RANDOM
numbers[i]=$randNum
echo ${numbers[i]}
}
echo ${numbers[0]}
Im able to print the value of the hash array inside the loop. But i expect to do it outside of it.