First page Back Continue Last page Graphics

Numeric loops: using until

Numeric loops: using until

This is the same loop, using until instead of while. Notice that it's only the comparison that changes with the command.

declare -i i=0

...

until (( i >= $max ))

do

echo i has the value $i

let i++

done