title: How can I replace multiple empty lines with a single empty line in bash?
body: <p>I have a file that contains:</p>
  
  <pre><code>something
  
  
  
  something else
  
  something else again
  </code></pre>
  
  <p>I need a bash command, sed/grep w.e that will produce the following output</p>
  
  <pre><code>something
  
  something else
  
  something else again
  </code></pre>
  
  <p>In other words, I need to replace multiple blank lines with just a single blank line. grep/sed are line based. I've never found a BASH solution that would work on multi-line regex patterns.</p>