title: Filtering for blocks (with headers) containing content in bash
body: <p>I have an output that looks like this:</p>
  
  <pre><code>foo-2
  ===========
  foo-3
  ===========
  bar bar bar
  yadda yadda
  blah blah
  foo-54
  ===========
  foo-26
  ===========
  </code></pre>
  
  <p>How do I print only what has text under it? Meaning, for this example its foo-3. But I also want it to work if the data appears in foo-54 as well...</p>
  
  <pre><code>foo-3
  ===========
  bar bar bar
  yadda yadda
  blah blah
  </code></pre>
  
  <p>I've trying "playing" with sed: <code>sed -n '/foo/,/^foo/!p'</code>, but it doesn't print the foo-3 itself + unnecessary ===== prints.</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: </p>
  
  <ol>
  <li><p>Re-reading the answers, I've apparently asked the wrong question. I don't know where my data is (whether its in foo-3 or foo-XXXXX).</p></li>
  <li><p>It doesn't have to be with sed. sed and awk are my "comfort zone"... Any solution will be appreciated.</p></li>
  </ol>