wikiti
12/18/2018 - 1:30 PM

Repeat a command until it fails

Run a command until it returns a non-zero exit code. Alternatively, run a command until it returns a zero exit code.

# Format
while <command>; do :; done

# Example
while bundle exec rspec spec/models/project_spec.rb:15; do :; done

# Alternatively, you may use `until` instead of `while` to run a command until it returns a 0 exit code.
until <command>; do :; done