[darcs-devel] darcs patch: Use an arithmetic for loop in the broken-pipe.sh test.

Guillaume Outters guillaume.outters at free.fr
Mon Mar 17 22:36:43 UTC 2008


Le 17 mars 2008 à 23:31, David a écrit :

> Guillaume, does Eric's patch work for you? The universal seq might be
> nice, but writing a straight for loop as he did is actually quite
> appealing as well.

No, as I said,
for (( $i=0 ; $i < 500; $i=$i+1 )); do echo $i ; done
gives errors ($i are dereferenced twice, thus bash ends up trying to  
exec "for (( 500=0 ; 500 < 500 […]").

for (( i=0 ; i < 500; i=i+1 )); do echo $i ; done
works though.

And, to be seq-compatible, it should be:
for (( i=1 ; i <= 500; i=i+1 ))

But I can only confirm this for bash 3, and I think bash 2 is still  
pretty used.

-- 
Guillaume



More information about the darcs-devel mailing list