What is the syntax for a Bash for
loop?
I have tried:
for (($i=0;$i<10;$i ++))
do
echo $i
done
I get this error:
line 1: ((: =0: syntax error: operand expected (error token is "=0")
What is the syntax for a Bash for
loop?
I have tried:
for (($i=0;$i<10;$i ++))
do
echo $i
done
I get this error:
line 1: ((: =0: syntax error: operand expected (error token is "=0")
Replace
with
Another way
The portable way is: