9.9 Control Commands
until condition
do
command list while condition is false
done
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:
#!/bin/sh
until [ $# -le 0 ]
do
echo $1
shift
done
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.