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

From: Xin LI <delphij_at_delphij.net>
Date: Wed, 04 Aug 2010 11:06:15 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 2010/08/03 11:21, Gabor Kovesdan wrote:
> 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'm able to reproduce the GNU behavior on 9.0-CURRENT which is IMO right.

I think we need to break at the line end to provide better interactivity
(the current code seems to do it (buffer is not full && !eof), while
what we wanted is (buffer is not full && !eof && !eol).

The attached patch should fix this but I have not yet thoroughly tested
it due to job work.

Cheers,
- -- 
Xin LI <delphij_at_delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQEcBAEBCAAGBQJMWawXAAoJEATO+BI/yjfBigMIAM2PHLXm2Qz4Kzhd8y+NYc2S
VKJVzNv6DAVMyqCXbezp6d+Qt4sls31uvFhizS9e6HZdUolqV4/m5AiM9UcF2wK4
i49PoQPSBs3Gpp0fuM4kxlZCp843ABkZfeYr2oFZluEA144jlA2bwrX598hmo2Ge
ikpljC/4R8e6TOdTNobcV4jTeHCcGYZv5nmCmODY4DZoGkFjXNQJL/zpHLYgaNyn
0j9TZ1okhaG/jLATlc+UhtyetB/wkN8VGNDyxQNg4a7iMw0xkqjoxMVpsoF4uoXS
YOcSEOXuvwHxs6jlkH7z0u06bmqqdv7Okw4OSANvGN35AuB7OQDrJWHdPBS9DZA=
=pZe0
-----END PGP SIGNATURE-----

Received on Wed Aug 04 2010 - 16:06:27 UTC

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