I've got four files:
./
./myscript.sh
./arguments.txt
./test.sh
Inside myscript.sh, I have to run the file test.sh, passing to it the arguments contained inside arguments.txt.
myscript.sh is:
arguments=$(cat arguments.txt)
source test.sh $arguments
This works well if arguments.txt contains at most one argument:
firstargument
The substitution is:
++ source test.sh 'firstargument'
But the problem is with two or more arguments. It does this:
++ source test.sh 'firstargument secondargument'
Also, I don't know in advance the number of arguments inside arguments.txt. There can be zero or more.
source test.sh "$arguments"with quotes? That would be one explanation for your descriptionsource test.sh "$arguments"andsource test.sh $argumentsboth result insource test.sh 'firstargument secondargument'.