title: What options to xargs will make it work with lines rather than words
body: <p>I want to use <code>xargs</code> (or similar concept) on lines with spaces.  In effect, if the input has</p>
  <pre><code>line one
  line two
  line three
  ...
  </code></pre>
  <p>and I call <code>xargs</code> such as <code>cat f | xargs foo</code>, then I want <code>xargs</code> to execute <code>foo &quot;line one&quot; &quot;line two&quot; &quot;line three&quot; ...</code> for as many arguments that fit on a command line.</p>
  <p>Currently I do this using the shell such as</p>
  <pre><code>cat list | while read f ; do foo $f ; done
  </code></pre>
  <p>but that calls <code>foo</code> for each line and it would be a bit more efficient if <code>foo</code> is called with a list rather than just one argument.</p>
  <p>The <code>-I</code> option, as documented, sounds like what I want but in my case (Free BSD), it is calling <code>foo</code> with only one argument.  <code>-L</code> and <code>-R</code> don't seem to help.</p>