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?
bash
,dash
,sh
,fish
, andzsh
which are the only shells I have installed at the moment. – DopeGhoti Jul 13 '18 at 21:45