I have a list of patterns in a text file, for which I use bzgrep to match on multiple files:
for pattern in $(cat ~/patterns.txt); do echo $pattern; bzgrep -i $pattern *.bz2; done
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?
Thanks