gabriel rosenkoetter on 3 Nov 2006 05:22:12 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Basic unix pipe question


On Wed, Nov 01, 2006 at 09:37:10AM -0500, Walt Mankowski wrote:
> On Tue, Oct 31, 2006 at 03:28:44PM -0500, George Gallen wrote:
> > you could also use tee
> > 
> > # program1 | tee program2
> You could try that, but you'll find you'll still have the same
> buffering problem.  I should know, I made exactly the same mistake a
> few days ago, and adding fflush(stdout) after each printf fixed it. :)

Or, depending on your tee(1) implementation, double the buffering
problem, with an extra context-switch on top.

(Hrm... actually, maybe somebody actually had the common sense to
specify that tee(1) needs to be unbuffered... Checking the man pages
for a few varieties says "The output is unbuffered.")

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpwiKQGWfdXl.pgp
Description: PGP signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug