title: bash script whole file reading into a variable with newline
body: <p>i want to read whole file in a variable. 
  for example my file is.</p>
  
  <p>file name : Q.txt</p>
  
  <pre><code>My name is Naeem Rehmat.
  I am a student of FAST university.
  Now i am in 4th semester.
  I am learning bash script.
  I have this problem.
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>text=$(cat Q.txt) 
  echo $text
  </code></pre>
  
  <p>out put should be like this:</p>
  
  <pre><code>My name is Naeem Rehmat.
  I am a student of FAST university.
  Now i am in 4th semester.
  I am learning bash script.
  I have this problem.
  </code></pre>