I' ve got this situation:
./
./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 if arguments.txt contains max one argument:
firstargument
The substitution is:
++ source test.sh 'firstargument'
But, and here is the real problem, with two arguments it does this:
++ source test.sh 'firstargument secondargument'
Also, i don't know in advice the number of arguments inside arguments.txt. There can be zero, one or more.
Thanks a lot for help in advance!
source test.sh "$arguments"
with quotes? That would be one explanation for your description – glenn jackman Jul 21 '14 at 19:55source test.sh "$arguments"
andsource test.sh $arguments
both result insource test.sh 'firstargument secondargument'
. – Federico Ponzi Jul 22 '14 at 7:38