From owner-freebsd-current@FreeBSD.ORG Sun Feb 20 15:37:56 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E81A106566C for ; Sun, 20 Feb 2011 15:37:56 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6D18FC16 for ; Sun, 20 Feb 2011 15:37:54 +0000 (UTC) Received: from endor.tataz.chchile.org (unknown [82.233.239.98]) by smtp5-g21.free.fr (Postfix) with ESMTP id 8A4D3D48174; Sun, 20 Feb 2011 16:37:48 +0100 (CET) Received: from felucia.tataz.chchile.org (felucia.tataz.chchile.org [192.168.1.9]) by endor.tataz.chchile.org (Postfix) with ESMTP id B209B33CF9; Sun, 20 Feb 2011 15:37:46 +0000 (UTC) Received: by felucia.tataz.chchile.org (Postfix, from userid 1000) id 9330CA14C7; Sun, 20 Feb 2011 15:37:46 +0000 (UTC) Date: Sun, 20 Feb 2011 16:37:46 +0100 From: Jeremie Le Hen To: "Matthew D. Fuller" Message-ID: <20110220153746.GB6573@felucia.tataz.chchile.org> References: <20110219185043.GA6573@felucia.tataz.chchile.org> <20110219203729.GE27891@over-yonder.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110219203729.GE27891@over-yonder.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@FreeBSD.org, Jeremie Le Hen Subject: Re: [RFC] Force stdio output streams to line-buffered mode 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: Sun, 20 Feb 2011 15:37:56 -0000 On Sat, Feb 19, 2011 at 02:37:29PM -0600, Matthew D. Fuller wrote: > On Sat, Feb 19, 2011 at 07:50:43PM +0100 I heard the voice of > Jeremie Le Hen, and lo! it spake thus: > > > > I've attached a small patch for stdio, so if the environment variable > > STDIO_IOLBF is set, the output streams will be line-oriented by default. > > iostat -x 1 | env STDIO_IOLBF=1 grep -v ad10 | cat -n > > I've no real comment on anything else (sounds like an interesting > hack, whatever else), but just for this particular case, you know that > grep has a --line-buffered arg, right? Yes indeed, my example wasn't especially smart :). Actually, I often stumble on this problem with an awk script I use to columize output. -- Jeremie Le Hen Humans are born free and equal. But some are more equal than others. Coluche