From owner-freebsd-current@FreeBSD.ORG Wed Aug 4 16:59:42 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE4E81065670 for ; Wed, 4 Aug 2010 16:59:42 +0000 (UTC) (envelope-from erik@barragry.com) Received: from limerick.barragry.com (limerick.barragry.com [64.85.174.160]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7348FC21 for ; Wed, 4 Aug 2010 16:59:42 +0000 (UTC) Received: by limerick.barragry.com (Postfix, from userid 1001) id 5B2EE55E40C1; Wed, 4 Aug 2010 11:40:45 -0500 (CDT) Date: Wed, 4 Aug 2010 11:40:45 -0500 From: freebsd-lists-erik@erikosterholm.org To: current@FreeBSD.org Message-ID: <20100804164045.GA52831@limerick.barragry.com> References: <86eiefhalp.wl%poyopoyo@puripuri.plala.or.jp> <4C585E44.5030608@FreeBSD.org> <1280933468.2752.2.camel@RabbitsDen> <20100804162809.GE59909@e.0x20.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100804162809.GE59909@e.0x20.net> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: bsdgrep does not work with tail -f | grep combination X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2010 16:59:42 -0000 On Wed, Aug 04, 2010 at 06:28:10PM +0200, Lars Engels wrote: > On Wed, Aug 04, 2010 at 10:51:08AM -0400, Alexandre Sunny Kovalenko wrote: > > On Tue, 2010-08-03 at 20:21 +0200, Gabor Kovesdan wrote: > > > Em 2010.08.03. 19:25, poyopoyo@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: > > [...] > > Same on Solaris, so this is not a GNU feature. Why is bsdgrep reading the whole file before processing, anyway? It seems like line-by-line processing would be the way to go. Erik