3

While reading about 11.12 Limitations of Shell Builtins I came across the following:

To loop over positional arguments, use:

for arg
do
   echo "$arg"
done

You may not leave the do on the same line as for, since some shells improperly grok:

for arg; do
   echo "$arg"
done

It doesn't seem to explain anymore detail than that.

Questions

  • What shells have a problem with this syntax?
  • What is the problem?
2