Why does the following only output 'b' and not 'b c'? What's the best way to make it output 'b c' please?
#!/usr/local/bin/bash
# The above is GNU bash, version 5.2.2(1)-release (x86_64-apple-darwin21.6.0)
# installed using Homebrew on macos Monterey
test() {
shift
xx=("$@")
}
test a b c
echo $xx
PS: Apologies if this is a duplicate - I searched but there were 14,501 results. :-(