I don't understand why "${ARRAY[@]}" gets expanded to multiple words, when it's quoted ("...")?
Take this example:
IFS=":" read -ra ARRAY <<< "foo:bar:baz"
for e in "${ARRAY[@]}"; do echo $e; done
foo
bar
baz
Any other variable that I expand in quotes, say "${VAR}", results in a single word:
VAR="foo bar baz"
for a in "${VAR}"; do echo $a; done
foo bar baz
Can anyone explain this to a novice Linux user?