title: Maintain line breaks in output from subshell
body: <p>When I execute a subshell to obtain output of a command, the line breaks are lost.</p>
  
  <p>For example:</p>
  
  <pre><code>filenames=$(grep 'foobar' /some/dir)
  echo $filenames
  </code></pre>
  
  <p>Assuming there is more than 1 file in <code>/some/dir</code> that contains the string "foobar", those filenames will be printed in one long space-separated line instead of 1 filename per line.</p>
  
  <p>I can't just use <code>tr</code> to convert the spaces back to line breaks since the filenames could have spaces in them anyway.</p>
  
  <p>Is there a way to maintain the line breaks?</p>