Run the bash script until it fails

TL;DR

while ./myscript.sh; do :; done

The one-liner above runs the specified script/command until it exits with a non-zero exit code.

Example:

Run the pytest test until it fails:

while pytest -k test_check_routing; do :; done

Leave a Reply

Your email address will not be published. Required fields are marked *