I have the following simple code in bash:
declare -A numbers
one_to_two=("one" "two")
three_to_four=("three" "four")
numbers["first"]="${one_to_two[@]}"
numbers["second"]="${three_to_four[@]}"
for var in "${!numbers[@]}"; do
values=("${numbers[$var]}")
for value in "${values[@]}"; do
echo -e "value: $value\n"
done
done
I was expecting to get something such as:
value: one
value: two
value: three
value: four
but instead I've got:
value: three four
value: one two
What am I missing? I have not much experience in bash