keyword
Bash until loop
Repeats while condition commands return nonzero. Returns the last body command status or zero if no body runs.
Formal Syntax & Structure
bash syntaxbash
until test-commands; do commands; doneReturn Value
exit status
Repeats while condition commands return nonzero. Returns the last body command status or zero if no body runs.
Working Example
Example Snippetbash
n=1until (( n == 4 )); do printf '%s\n' "$n" n=$(( n + 1 ))done