malcolm@commsecure.com.au wrote:
> In bash2 versions up to 2.04, a loop of the form
>
> for i in $WORDS
> do
> <stuff>
> done
>
> would not execute the loop body if $WORDS expanded to nothing.
> In version 2.05, this situation generates a syntax error.
No, it doesn't.
> Repeat-By:
>
> for i in ; do echo foo; done
This *is* an error, but it's different code. A variable with an empty
value is different from no variable at all. I assume you have
something like this in a Makefile:
for i in $(var); do
use $$i
done
You can make it work like this:
var="$(var)"
for i in $$var; do
use $$i
done
paul