Skip to content

Instantly share code, notes, and snippets.

@wikiti
Created December 18, 2018 13:30
Show Gist options
  • Save wikiti/b36a3e4fa584fc15f26a1adc8bcbbb2d to your computer and use it in GitHub Desktop.
Save wikiti/b36a3e4fa584fc15f26a1adc8bcbbb2d to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment