-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC3005
Vidar Holen edited this page Dec 12, 2021
·
2 revisions
for ((i=0; i<10; i ))
do
echo "$i"
done
i=0
while [ "$i" -lt 10 ]
do
echo "$i"
i=$((i 1))
done
C-style arithmetic for loops are a Ksh/Bash feature that's not supported by POSIX sh or dash. Use a while
loop with separate initialization and incrementing instead.
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!