I am looking to write a small korn shell script doing 5 tests (by waiting some time before each one) and then, if they all fail, performing an action.I was looking at doing something like :    for i in {1..5}    do       doMyTest             #it fills a variables status (but can unfortunately fails)       if [ $status ]; then #if status is filled then we can leave the loop          break       fi       sleep 3                #else wait some time before doing another try    done    if [ -z $status ]; then       exit 1    fi... then the rest of my programDo you have any idea how could I do this in a better way ? It sounds a bit redundant ...
ksh, perform action when reaching loop maximal value
shell;ksh
set --while [ $(($#>5)) -eq -${#status} ]do    test; ${status:+:} sleep 3      set '' $@doneIf you test by complement you can often do a lot more with one test.