title: How to pass command line arguments with spaces through a variable in bash
body: <p>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?</p>
  
  <p>Not working code, to illustrate the problem:</p>
  
  <p>file.txt contents (quotes are there just to show two different arguments):</p>
  
  <pre><code>"aaa bbb" "xxx yyy"
  </code></pre>
  
  <p>shell script:</p>
  
  <pre><code>ARGS=$(cat file.txt)
  /some/command $ARGS
  </code></pre>
  
  <p><code>/some/command</code> should receive two arguments: <code>aaa bbb</code> and <code>xxx yyy</code>. I do have control of generated file.txt and the shell script itself.</p>