ordering of printed lines changes when redirecting

2016-07-18 Thread walter harms
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.2 -L/home/abuild/rpmbuild/BUILD/bash-4.2/../readline-6.2 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread Pierre Gaston
On Mon, Jul 18, 2016 at 11:22 AM, walter harms wrote: > > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.2 > -L/home/abuild/rpmbuild/BUILD/bash-4.2/../readline-6.2 > Compilation CFLAGS: -D

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread Greg Wooledge
On Mon, Jul 18, 2016 at 10:22:46AM +0200, walter harms wrote: > ( ./a.out 2>&1 ) > hallo 5 > hallo 6 > hallo 7 > hallo 8 > hallo 9 (snip) > ./a.out >xx 2>&1 > cat xx > hallo 6 > hallo 8 > hallo 5 > hallo 7 > hallo 9 Looks like an artifact of stdio (libc) buffering. When stdout and stderr are

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread walter harms
Am 18.07.2016 15:59, schrieb Greg Wooledge: > On Mon, Jul 18, 2016 at 10:22:46AM +0200, walter harms wrote: >> ( ./a.out 2>&1 ) >> hallo 5 >> hallo 6 >> hallo 7 >> hallo 8 >> hallo 9 > > (snip) > >> ./a.out >xx 2>&1 >> cat xx >> hallo 6 >> hallo 8 >> hallo 5 >> hallo 7 >> hallo 9 > > Looks

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread 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 -- ``The lyf so short,

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread walter harms
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-B

Re: ordering of printed lines changes when redirecting

2016-07-18 Thread Pádraig Brady
On 18/07/16 14:59, Greg Wooledge wrote: > On Mon, Jul 18, 2016 at 10:22:46AM +0200, walter harms wrote: >> ( ./a.out 2>&1 ) >> hallo 5 >> hallo 6 >> hallo 7 >> hallo 8 >> hallo 9 > > (snip) > >> ./a.out >xx 2>&1 >> cat xx >> hallo 6 >> hallo 8 >> hallo 5 >> hallo 7 >> hallo 9 > > Looks like a