From owner-freebsd-current@FreeBSD.ORG Wed Aug 4 17:29:37 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 AD15C106566B for ; Wed, 4 Aug 2010 17:29:37 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 61C738FC1F for ; Wed, 4 Aug 2010 17:29:37 +0000 (UTC) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 1B8AE5AD20; Wed, 4 Aug 2010 19:02:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id 182A55AD1F; Wed, 4 Aug 2010 19:02:57 +0200 (CEST) X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id E96A75CDB4; Wed, 4 Aug 2010 19:02:56 +0200 (CEST) Received: from wep4035.physik.uni-wuerzburg.de ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.5.1FP3) with ESMTP id 2010080419025560-40122 ; Wed, 4 Aug 2010 19:02:55 +0200 Date: Wed, 4 Aug 2010 19:02:55 +0200 From: Alexey Shuvaev To: Lars Engels Message-ID: <20100804170255.GA14967@wep4035.physik.uni-wuerzburg.de> 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 In-Reply-To: <20100804162809.GE59909@e.0x20.net> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.20 (2009-06-14) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.5.1FP3|May 23, 2010) at 08/04/2010 07:02:56 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.5.1FP3|May 23, 2010) at 08/04/2010 07:02:56 PM, Serialize complete at 08/04/2010 07:02:56 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: poyopoyo@puripuri.plala.or.jp, Alexandre Sunny Kovalenko , Gabor Kovesdan , current@FreeBSD.org 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 17:29:37 -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. > Just to clarify things, bsdgrep of course works with tail -f, the data just sits in its buffer: ~> jot 10 > test ~> tail -f test | grep 0 [on another terminal] ~> jot 10 >> test [nothing happens on original terminal] ~> jot 4000 >> test [on the original terminal] 10 10 10 20 30 40 50 60 70 80 90 100 101 102 103 [snip] 3950 3960 3970 3980 3990 4000 Alexey.