9.9 Control Commands
command list while condition is false
The condition is tested at the start of each loop and the loop is terminated when the condition is true. A script equivalent to the while examples above is:
until [ $# -le 0 ]
Notice, though, that here we're testing for less than or equal, rather than greater than or equal, because the until loop is looking for a false condition.
Both the until and while loops are only executed if the condition is satisfied. The condition is evaluated before the commands are executed.