Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!emory!gatech!purdue!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: redirected output is buffered, how do you flush it? Message-ID: <1892:Feb521:11:4591@kramden.acf.nyu.edu> Date: 5 Feb 91 21:11:45 GMT References: <1991Feb05.000629.7401@convex.com> Organization: IR Lines: 15 In article <1991Feb05.000629.7401@convex.com> tchrist@convex.COM (Tom Christiansen) writes: > This is a general problem that comes up often, and I don't know any > way of doing it unless you can get the program doing the writes to > flush its buffers now and then. Here's a very easy general solution: Run % pty script > some_file rather than % script > some_file. This will work for any program that uses stdio normally. pty appeared in comp.sources.unix volume 23 and is available via anonymous ftp to 128.122.128.22 in pub/hier/pty/*. It works on most BSD systems. The original poster should check around at gatech for a copy. ---Dan Stupidity, n.: An overwhelming desire to rewrite one-line shell scripts as 36-line Perl scripts so they run 6% faster. See Christiansen, Tommy.