bug-bash
[Top][All Lists]
Advanced

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

Re: ordering of printed lines changes when redirecting


From: walter harms
Subject: Re: ordering of printed lines changes when redirecting
Date: Mon, 18 Jul 2016 18:18:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11


Am 18.07.2016 16:36, schrieb Chet Ramey:
> On 7/18/16 10:11 AM, walter harms wrote:
> 
>> NTL i would recommend to add one or two line about buffering into
>>     the ducomentation :)
> 
> It's already documented in the right place:
> 
> https://www.gnu.org/software/libc/manual/html_node/Stream-Buffering.html#Stream-Buffering
> 
> 

to be serious, who will look into libc documentation when
./a.out >xx 2>&1   and  ./a.out 2>&1   behave differently ?

They will, as i did, check if there is something special with redirections.

what about:

Note:
be aware that when merging output (e.g. 2&>1) the sequence can differ depending
on the buffering used by your programm. use setvbuf() to control buffering.
see also: 
https://www.gnu.org/software/libc/manual/html_node/Stream-Buffering.html#Stream-Buffering
or see man setvbuf

adjust as you like

re,
 wh




reply via email to

[Prev in Thread] Current Thread [Next in Thread]