Given a bash array, I'd like to call another script with that array as an argument. I expected that the ${X[@]} would do what I want, but that string concats the args, rather than passing args separately. For example:
X=()
X+='a'
X+='b'
./p.sh ${X[@]}
Calls p.sh with 1 arg whose value is 'ab'. I want to call p.sh with 2 args, the first being 'a' the second being 'b'.
X+=('a')