title: print formatted output in bash variables
body: <p>I am using a bash script where I must store the last n-2 lines of a file in a variable. 
  The command I use for this is </p>
  
  <pre><code>last_n2_lines=`tail -n+3 $file`
  </code></pre>
  
  <p>Now whenever i echo the $last_n2_lines variable, I get all the lines of my file in a single line. How can I get the same formatting as I had in my original file. I tried printf but it just prints the first field.</p>