LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > goumba
User Name
Password

Notices


bash scripting Snippets and full bash scripts.
Old

[bash] Continue to attempt running a command until it succeeds, or a specified number of tries.

Posted 08-12-2014 at 10:56 PM by goumba

Inspired by the dsc in his post, http://www.linuxquestions.org/questi...og.php?b=36164, I decided to try and get the number of tries part working, and here's what I came up with:

Code:
#!/bin/bash                                                                     
set -x # remove/comment when you no longer wish to see debugging output

case $1 in
    [0-9]*)
        max=$1
        # shift so that $@ only contains the command we're interested
...
Senior Member
Posted in bash scripting
Views 677 Comments 6 goumba is offline

  



All times are GMT -5. The time now is 08:09 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration