title: How to avoid bash command substitution to remove the newline character?
body: <p>To speed up some bash script execution, I would like to keep the result of a command in a variable using command substitution, but the command substitution replaces the <code>0x0A</code> newline character by a space. For example:</p>
  
  <pre><code>a=`df -H`
  </code></pre>
  
  <p>or</p>
  
  <pre><code>a=$( df -H )
  </code></pre>
  
  <p>When I want to process further <code>$a</code>, the newline characters are replaced by a space and all the lines are now on one line, which is much harder to grep:</p>
  
  <pre><code>echo $a
  </code></pre>
  
  <p>What would be the easy tricks to avoid the newline character being removed by the command substitution?</p>