Created
March 23, 2023 21:25
-
-
Save leite08/923557b6535ebb20dca6ca5baf41fc4f to your computer and use it in GitHub Desktop.
Shell script to run a command 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 | |
count=0 | |
while "$@"; do (( count++ )); done && echo "It failed on the $count iteration" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment