title: while grep multiple files, how do I stop after first match?
body: <p>I have a list of patterns in a text file, for which I use bzgrep to match on multiple files:</p>
  
  <pre><code>for pattern in $(cat ~/patterns.txt); do echo $pattern; bzgrep -i $pattern *.bz2; done
  </code></pre>
  
  <p>How do I make bzgrep (grep) stop after the first match of the current pattern (I need it stop completely, not stop on the current file being grep'ed) and go on to the next pattern.  I have read about "-m 1" parameter, but I think it only stops on the current file.  Any ideas?</p>
  
  <p>Thanks</p>