A ! has been put to reverse the less than condition so it becomes a greater than condition It loops until a becomes greater than 10. Why am I getting the output only till 9? It should reach 11, when its greater than 10, right? How do I fix this?
Code:
#!/bin/bash
a=0
until [ ! $a -lt 10 ]
do
echo $a
a = `expr $a + 1`
done
Output:
0
1
2
3
4
5
6
7
8
9
Bookmarks