Bash Until Loop


Example

Until loop executes until condition is true

i=5
until [[ i -eq 10 ]]; do #Checks if i=10
    echo "i=$i" #Print the value of i
    i=$((i+1)) #Increment i by 1
done

Output:

i=5
i=6
i=7
i=8
i=9

When i reaches 10 the condition in until loop becomes true and the loop ends.