Created
January 30, 2018 08:20
-
-
Save neocoder/3003df7ae9e8ae8f79d13b7ab72dc2b1 to your computer and use it in GitHub Desktop.
runs command until it finishes with error code
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
#!/usr/bin/env bash | |
counter=0 | |
while [ $? -eq 0 ]; do | |
counter=$((counter+1)) | |
clear | |
echo "Iteration: $counter"; | |
$@ | |
done | |
declare -r x="Crashed at ${counter} iteration" | |
echo $x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment