In my problem, it appears like j
value and i
value reach 6
; where i
should only run up to 5
. Can someone please explain ?
i=0;
j=0;
echo "values of $i and $j" > debug.txt;
while [ $j -le 5 ]
do
j=expr $j + 1
i=expr $i + 1
echo "values of $i and $j" >> debug.txt
done;
cat debug.txt;
OUTPUT :
value of i is 0 and j is 0
value of i is 1 and j is 1
value of i is 2 and j is 2
value of i is 3 and j is 3
value of i is 4 and j is 4
value of i is 5 and j is 5
value of i is 6 and j is 6