[lug] Strange stderr redirection

Daniel Webb lists at danielwebb.us
Sat Jan 24 16:26:02 MST 2004


On Sat, 24 Jan 2004, Budyanto Himawan wrote:

> Thats interesting. Which lines are from stdout and
> which ones are from stderr?

Sorry, I meant to include that... the lines with "key:" and the dashed
lines are stderr, the other are stdout.  So stderr gets out before before
it should be when combining stdout and stderr.

> By default stdout is line buffered and stderr is
> unbuffered. You can try to use setvbuf to set stdout
> to unbuffered and see what happens.

I tried setvbuf and that did the trick.  Incidentally, after that worked,
I commented the setvbuf line out and tried again, and now the fflush()es
work...  Oh well, either I did something stupid or there's a tough bug,
probably the former.

Thanks,
Daniel




More information about the LUG mailing list