Created
August 22, 2017 15:17
-
-
Save fionn/49cdd1bd3e051a66b601b65a6bbfc3ea to your computer and use it in GitHub Desktop.
Repeat a Python program until it fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -ne 1 ]]; then | |
echo "Requires 1 argument; $# given" | |
exit 1 | |
fi | |
while true; do | |
python $1 | |
if [[ $? -ne 0 ]]; then | |
exit $? | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment