Kris Maglione writes:
> On Tue, Jun 08, 2010 at 07:49:50PM +0200, David Engster wrote:
>>It seems Ubuntu installs 'mawk' for providing 'awk', which by default
>>buffers its input, so the above won't do anything. Ubuntu users will
>>have to install 'original-awk' and symlink/rename that to awk, or - even
>>worse - use some obscure '-W interactive' option from mawk in the above
>>line.

> Are you sure that input buffering is the problem?  Usually, in cases
> like this, input buffers are flushed as soon as a newline is read. I
> rather suspect that it's the fflush call that's the problem. Perhaps
> fflush("") would do the job.

No, doesn't work. Neither does system(""). Maybe it's the output that
gets buffered, I don't know. All I know is that awk and gawk work, and
mawk only works with "-W interactive" ("sets unbuffered writes to stdout
and line buffered reads from stdin"). Ah well...

-David


Reply via email to