What I'm trying to achieve is to read command line arguments from a file and invoke a command using them. So essentially I need to pass the arguments through a bash variable. The problem is that some arguments have spaces in them. How can I do that?
Not working code, to illustrate the problem:
file.txt contents (quotes are there just to show two different arguments):
"aaa bbb" "xxx yyy"
shell script:
ARGS=$(cat file.txt)
/some/command $ARGS
/some/command
should receive two arguments: aaa bbb
and xxx yyy
. I do have control of generated file.txt and the shell script itself.