Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2011 16:37:46 +0100
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        "Matthew D. Fuller" <fullermd@over-yonder.net>
Cc:        freebsd-current@FreeBSD.org, Jeremie Le Hen <jeremie@le-hen.org>
Subject:   Re: [RFC] Force stdio output streams to line-buffered mode
Message-ID:  <20110220153746.GB6573@felucia.tataz.chchile.org>
In-Reply-To: <20110219203729.GE27891@over-yonder.net>
References:  <20110219185043.GA6573@felucia.tataz.chchile.org> <20110219203729.GE27891@over-yonder.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110220153746.GB6573>