title: sed emulate "tr | grep"
body: <p>Given the following file</p>
  
  <pre class="lang-none prettyprint-override"><code>$ cat a.txt
  FOO='hhh';BAR='eee';BAZ='ooo'
  </code></pre>
  
  <p>I can easily parse out one item with <code>tr</code> and <code>grep</code></p>
  
  <pre><code>$ tr ';' '\n' &lt; a.txt | grep BAR
  BAR='eee'
  </code></pre>
  
  <p>However if I try this using <code>sed</code> it just prints everything</p>
  
  <pre><code>$ sed 's/;/\n/g; /BAR/!d' a.txt
  FOO='hhh'
  BAR='eee'
  BAZ='ooo'
  </code></pre>