Re: bsdgrep does not work with tail -f | grep combination

From: Alexandre \ <gaijin.k_at_ovi.com>
Date: Wed, 04 Aug 2010 10:51:08 -0400
On Tue, 2010-08-03 at 20:21 +0200, Gabor Kovesdan wrote:
> Em 2010.08.03. 19:25, poyopoyo_at_puripuri.plala.or.jp escreveu:
> > Hi,
> >
> > It seems bsdgrep does not work when piped from tail -f.
> > I'm running r210728.
> >
> > term0$ jot 10>  /tmp/1
> > term0$ tail -f /tmp/1 | grep 0
> > [no output]
> >
> > otherterm$ jot 10>>  /tmp/1
> > [no output to term0]
> >
> > =====
> >
> > with GNU grep:
> >
> > term0$ tail -f /tmp/1 | gnugrep 0
> > 10
> > otherterm$ jot 10>>  /tmp/1
> > [on term0]
> > 10
> > 10
> >    
> I've checked on 8.0 and GNU grep doesn't output anything either for me. 
> If you use tail -f, you will enter more lines and end it with EOF, won't 
> you? And then BSD grep will process the input and print out matches. I 
> don't think it's bad behaviour in itself but if you can explain why you 
> think it's bad I'm willing to change it.
> 
I am not sure it is specific to the GNU grep -- below is the example
from AIX 5.3:

sunny_at_irptdev_1>tail -f engine.log | grep Hello    
Aug  4 10:41:39 irptdev_1 local3:debug sunny: Hello Wed Aug 4 10:41:39
EDT 2010 
Aug  4 10:41:46 irptdev_1 local3:debug sunny: Hello Wed Aug 4 10:41:46
EDT 2010 
Aug  4 10:41:57 irptdev_1 local3:debug sunny: Hello Wed Aug 4 10:41:57
EDT 2010 

I am doing 

sunny_at_irptdev_1>logger -p local3.debug Hello `date`
sunny_at_irptdev_1>logger -p local3.debug Hello `date`
sunny_at_irptdev_1>logger -p local3.debug Hello `date`

from different terminal window.

HTH,
-- 
Alexandre Kovalenko (Олександр Коваленко)



--------------------------------------------------------------
Ovi Mail: Making email access easy
http://mail.ovi.com
Received on Wed Aug 04 2010 - 13:44:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:05 UTC