Bash is useful up to a point

As far as I can tell is there no way in Bash to pass a concatenated array to an internal function and not have the resulting string split apart. Eg

function f() {
    for e in "$@"
    do
        echo $e
    done
}

A=( x y z )

f a b "${A[@]}" 'c d' "e f"

will output

a
b
x
y
z
c d
e f

when I expected it to output

a
b
x y z
c d
e f

Google and stackoverflow.com both failed me, as did trying lots of variations.

No comments: