Pattern: Use of arithmetic expression that modifies variable
Issue: -
You are using an arithmetic expression that modifies a variable, e.g. $((x+=1))
or $((x++))
, in the name of a file to redirect from/to, in a here document, or in a here string.
Example of incorrect code:
curl "$URL" > "image$((i++)).jpg"
Example of correct code:
i=$((i+1))
curl "$URL" > "image$i.jpg"