title: Call function in bash script with arguments from file with spaces
body: <p>I am wanting to execute a command with arguments read in from a file.
  This works fine, until 1 of the arguments needs to have a space.</p>
  
  <p>I have tried grouping the words with quotes and backslashes, but neither have worked.</p>
  
  <p>The functionality I am after is exactly what <code>xargs</code> does, except I need to call a function rather than a command as it relies on other variables set up elsewhere in the script</p>
  
  <p>script:</p>
  
  <pre><code>do_echo() {
      echo '$1:' $1
      echo '$2:' $2
  }
  line=`cat input.txt` #cat used for simplicity, can have more than 1 line
  do_echo $line
  </code></pre>
  
  <p>input.txt:</p>
  
  <pre><code>"hello world" "hello back"
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>$1: hello world
  $2: hello back
  </code></pre>
  
  <p>Observed result:</p>
  
  <pre><code>$1: "hello
  $2: world"
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I am using this to execute the same command multiple times with different inputs.
  There is up to 15 parameters per line, and could be upwards of 50 lines.</p>
  
  <p>A tabular format would be ideal, although the current answer of putting each parameter on a line will work.</p>