Re: lost output from asynchronous lists

2008-11-03 Thread Sven Mascheck
PS: Traditional shells (only) are too offtopic on bug-bash; I guess, we better limit to bug-autoconf.

Re: lost output from asynchronous lists

2008-11-02 Thread Stephane Chazelas
On Sat, Nov 01, 2008 at 11:21:01PM -, Sven Mascheck wrote: [...] > : > stdout > stderr [...] > > It fails on old Ultrix sh, which can't redirect the same fd more than once > > in a single statement. But that platform is relatively dead these days. > > More detailed: > > - It actually w

Re: lost output from asynchronous lists

2008-11-02 Thread Ralf Wildenhues
* Stephane Chazelas wrote on Sun, Nov 02, 2008 at 09:53:15AM CET: > On Sat, Nov 01, 2008 at 11:21:01PM -, Sven Mascheck wrote: > [...] > > : > stdout > stderr > [...] > > > It fails on old Ultrix sh, which can't redirect the same fd more than once > > > in a single statement. But that pl

Re: lost output from asynchronous lists

2008-11-01 Thread Sven Mascheck
Eric Blake wrote: > According to Stephane Chazelas on 10/29/2008 3:32 AM: : > stdout > stderr >>> >>> For shell portability, I'll write the first line as >>> : > stdout >>> : > stderr >>> though. >> >> Why? > > It fails on old Ultrix sh, which can't redirect the same fd more than once

Re: lost output from asynchronous lists

2008-10-29 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 10/29/2008 6:22 AM: >>> - ( :; $1 ) >"$at_stdout" 2>"$at_stderr" >>> + : >"$at_stderr" >>> + ( :; $1 ) >>"$at_stdout" 2>>"$at_stderr" >> What's the ":;" for? > > A workaround to the bash 3.2 bug, fixed in bash32-030, wher

Re: lost output from asynchronous lists

2008-10-29 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Stephane Chazelas on 10/29/2008 3:32 AM: >> Yes. For shell portability, I'll write the first line as >> : > stdout >> : > stderr >> >> though. > > Why? It fails on old Ultrix sh, which can't redirect the same fd more than once in a

Re: lost output from asynchronous lists

2008-10-29 Thread Stephane Chazelas
On Tue, Oct 28, 2008 at 10:51:13PM +0100, Ralf Wildenhues wrote: [...] > > : > stdout > stderr [...] > Yes. For shell portability, I'll write the first line as > : > stdout > : > stderr > > though. Why? I can't see why ": > stdout > stderr" wouldn't work in any shell. It should even work in

Re: lost output from asynchronous lists

2008-10-28 Thread Ralf Wildenhues
Hi Stephane, * Stephane Chazelas wrote on Tue, Oct 28, 2008 at 11:26:18AM CET: > > I have to admit I would have thought the code above to be safe > as well and I wonder if it's the same on all systems. But I can > reproduce the problem on Linux. As far as I can tell, if you > don't use O_APPEND,

Re: lost output from asynchronous lists

2008-10-28 Thread Stephane Chazelas
On Mon, Oct 27, 2008 at 11:12:24PM +0100, Ralf Wildenhues wrote: [...] > --- foo.sh --- > #! /bin/sh > > do_work () > { > sleep 1 > echo "work $i is done" > } > > for i in 1 2 3 4 5 6 7 8 9 10 > do > ( > do_work $i > ) & > done > wait > > --- bar.sh --- > #! /bin/sh > > ./foo.sh > s