title: How to store and echo multiple lines elegantly in bash?
body: <p>I'm trying to capture a block of text into a variable, with newlines maintained, then echo it.</p>
  <p>However, the newlines don't seemed to be maintained when I am either capturing the text or displaying it.</p>
  <p>Any ideas regarding how I can accomplish this?</p>
  <p><strong>Example:</strong></p>
  <pre><code>#!/bin/bash
  
  read -d '' my_var &lt;&lt;&quot;BLOCK&quot;
  this
  is
  a
  test
  BLOCK
  
  echo $my_var
  </code></pre>
  <p><strong>Output:</strong></p>
  <blockquote>
  <p>this is a test</p>
  </blockquote>
  <p><strong>Desired output:</strong></p>
  <blockquote>
  <p>this</p>
  <p>is</p>
  <p>a</p>
  <p>test</p>
  </blockquote>