Let's say if I have a code like this.
var=0 while [ condition ] do ((var+=1)) done echo $var
How can I increment
$var inside the loop and display its value outside of it? Thanks
Let's say if the loop runs for 5 times, my
$var, the output should be
5. But now I only got
0 even if the loop runs for like 10 times.
$var is just not incremented inside the loop.