You can use the
until statement to execute a series of commands until a specified condition is
The loop terminates as soon as the specified condition evaluates to
bash, the following format is used:
until expressiondo statementsdone
As you can see, the format of the
until statement is similar to that of the
while statement, but the logic is different: In a
while loop, you execute until an expression is false, but in an
until loop, you loop until the expression is true. An important part of this difference is that
while is executed zero or more times (potentially not executed at all), but
until is repeated one or more times, meaning it is executed at least once.
If you want to add the first five ...