From owner-freebsd-current@FreeBSD.ORG Wed Aug 4 17:45:49 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 69DA1106566C for ; Wed, 4 Aug 2010 17:45:49 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 190178FC1A for ; Wed, 4 Aug 2010 17:45:48 +0000 (UTC) Received: by qwg5 with SMTP id 5so1473547qwg.13 for ; Wed, 04 Aug 2010 10:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JO4f991akayAO2eXyauSeln13w79wc18zmCRkiZAtPs=; b=biwPWoIKSjNGCR40L8YJsOazE/XzwTnxM+0yB5m1knl5Mkkpqc4yhWE1Mgv9xq4AP3 9W+MGNu5et/Tueg6JrUQeWJzIlgxWGIBxEBb7kZt+lNs5chpleXnCXyc9WZKCYa1Gi6d 5Fqe63tKxJKkLNsIsji1iFSYRVxqjsSSh73sA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=i6TZvY0GvBqjIGzck/zOX3WYC+JH5/PdS26JgH9jAWFvJgbLpxB94ad0eZIz8eh0ss yPyDqv2YzzmK2pGPzkW15gYmPdSJHpQBhecxe/PCIvhSIbwPy1x2ouW4TmzN7SpYcGSu FMg61vx4kKHdRWDj/FEun39Usc9goXiZIPt+c= MIME-Version: 1.0 Received: by 10.229.231.3 with SMTP id jo3mr2646260qcb.21.1280942529332; Wed, 04 Aug 2010 10:22:09 -0700 (PDT) Received: by 10.229.48.12 with HTTP; Wed, 4 Aug 2010 10:22:09 -0700 (PDT) In-Reply-To: <20100804162809.GE59909@e.0x20.net> References: <86eiefhalp.wl%poyopoyo@puripuri.plala.or.jp> <4C585E44.5030608@FreeBSD.org> <1280933468.2752.2.camel@RabbitsDen> <20100804162809.GE59909@e.0x20.net> Date: Wed, 4 Aug 2010 21:22:09 +0400 Message-ID: From: pluknet To: Lars Engels Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:45:49 -0000 On 4 August 2010 20:28, 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> =A0/tmp/1 >> > > term0$ tail -f /tmp/1 | grep 0 >> > > [no output] >> > > >> > > otherterm$ jot 10>> =A0/tmp/1 >> > > [no output to term0] >> > > >> > > =3D=3D=3D=3D=3D >> > > >> > > with GNU grep: >> > > >> > > term0$ tail -f /tmp/1 | gnugrep 0 >> > > 10 >> > > otherterm$ jot 10>> =A0/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 yo= u >> > 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. > By the way, egrep from 4.4BSD-Alpha used read(2) with 8k blocks. I justed checked, it works with tail -f. --=20 wbr, pluknet