On Thu, Nov 23, 2006 at 03:28:24PM +1100, Zhasper wrote: > On 11/23/06, Matthew Hannigan <[EMAIL PROTECTED]> wrote: > >On Thu, Nov 23, 2006 at 01:30:50PM +1100, Penedo wrote: > >> On 23/11/06, Matthew Hannigan <[EMAIL PROTECTED]> wrote: > >> >On Thu, Nov 23, 2006 at 08:23:37AM +1100, Penedo wrote: > >> >> On 23/11/06, Howard Lowndes <[EMAIL PROTECTED]> wrote: > >> >> >I want to tail -f the syslog file but I only want to see what I want > >to > >> >> >see and I don't want to see what I don't what to see. The idea is to > >> >> >tail follow through a filter. Is that possible. > >> >> > >> >> What's wrong with "tail -f syslog | grep ..."? > >> > > >> >Buffering > >> > >> Can you elaborate? It works for me (I mean - I get the output through > >> grep as soon as tail wakes up and reads the line). > > > >Yeah, I was a little terse/inaccurate. > >One grep is fine, two greps ain't so good. > >(tail -f blah | grep wanted | grep -v notwanted) > > Could you expand on what makes this "not so good"?
You don't get the output in as timely a fashion; it comes with spurts as the buffer is filled up then written out. Try this out: while true ; do s=$RANDOM; echo $s; usleep $s; done >crap & tail -f crap |grep 3 vs tail -f crap | grep 3 | grep -v 8 Matt -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html