I am creating a detached screen, player, that runs the script, player.sh, which has multiple arguments from AR, array.
AR=('foo' 'bar' 'space' 'bat')
screen -S player -dm bash -c "/home/deanresin/scripts/player.sh ${AR[@]}"
but it gets parsed as...
+ screen -S player -dm bash -c '/home/deanresin/scripts/player.sh foo' bar space bat
and only the first argument, foo, is passed to player.sh.
If I manually enter the array it works..
screen -S player -dm bash -c "/home/deanresin/scripts/player.sh foo bar space bat"
+ screen -S player -dm bash -c '/home/deanresin/scripts/player.sh foo bar space bat'
and they all get passed to player.sh.
Please help, I've been pulling my hair out.
edit:
I also tried..
screen -S player -dm bash -c "/home/deanresin/scripts/player.sh "`echo "${AR[@]}"`
with the same unwanted result.