commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
There is 1 alternative - vote for the best!
Executes the previously-run command constantly until it returns 0 (success). Put a
Repeat the previously used command (!!) until it exits with a success code (0). To put a delay between attempts you could do something like
until !!; do sleep 5; done
to wait 5 seconds after each attempt.
You want bash to keep running the command until it is successful (until the exit code is 0). Give a dummy command, which sets the exit code to 1 then keep running your command until it exits cleanly
If you can do better, submit your command here.
You must be signed in to comment.