For a vaguely similar use case (repeat till host is up) I once wrote
until ssh ...; do sleep 5; done
which stops looping once a connection succeeds. until ssh ...; do sleep 5; done
which stops looping once a connection succeeds. while :;do ssh ... && break; sleep 5; done while(1) {
if (condition)
break;
...
}
stuff I've seen too much of and can't explain, instead of just while(!condition) { ... }. for(;;){
if(condition) break;
}(Also, I don't understand why a for(;;) loop is more attractive than a while(1) loop.)