For Loop without a list-of-words parameter

suggest change
for arg; do
    echo arg=$arg

A for loop without a list of words parameter will iterate over the positional parameters instead. In other words, the above example is equivalent to this code:

for arg in "$@"; do
    echo arg=$arg

In other words, if you catch yourself writing for i in "$@"; do ...; done, just drop the in part, and write simply for i; do ...; done.

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents