This is the mail archive of the
mailing list for the Cygwin project.
Re: echo vs. ls race condition?
Fred Kulack <firstname.lastname@example.org> writes:
> Interesting tests. I still can't get it to fail...
Note _I_ can't get it to fail with only 10 subdirs -- 100 or 200 are
much more reliable at producing the problem. . .
> What terminal are you using? Perhaps there's something weird going on with
> flow control as descriptors are dup'd for the utilities there?
> I'm using plain old winblows console.
I can reproduce using windows console plus bash
> Did you try the regular echo instead of the builtin? It may have different
> with regard to this.
OK, so _that's_ interesting -- using /bin/echo _and_ running under
windows console I _cannot_ reproduce. Either running under rxvt _or_
using builtin echo produces the problem. Also, using /bin/sh to run
the loop does _not_ reproduce the problem, even with builtin echo.
Here's a hack way to test for the bug automatically, by the way:
> command ls -d * | while read d; do /bin/echo -e "\n-$d-"; ls $d ; done > xxx
> egrep -A2 'aaa' xxx| tr -d '\012' | sed 's/--/\
/g' | egrep 'aaa.*aaa'
> uname -a
CYGWIN_NT-5.1 francis 1.5.9(0.112/4/2) 2004-03-18 23:05 i686 unknown
> cygcheck -cd bash
Cygwin Package Information
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: email@example.com
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html