Subject: multiple greps, buffering, regular expressions
To: None <netbsd-users@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-users
Date: 05/01/2001 14:06:52
I want to be able to easily use multiple greps, like:

tail -f logfile | grep keyword | grep -v exclude-keyword

But due to the stdio buffering I may not (quickly) receive a result.

Can anyone share some examples of using grep (or sed or awk) to output the
lines that match the keyword and don't match the exclude-keyword as "tail
-f" outputs them?

How can a combine my two greps above into one grep command (when I don't
know what order the keywords will be in it)?

Thanks,

   Jeremy C. Reed
   http://www.reedmedia.net/