3 ms·
while :;do ssh ... && break; sleep 5; done
by micro_softy 10y ago
while :;do ssh ... && break; sleep 5; done
- yuubi 10y agoWhy? That reminds me of the while(1) { if (condition) break; ... } stuff I've seen too much of and can't explain, instead of just while(!condition) { ... }.
- micro_softy 10y agoI'm not much of C programmer but I think it's an approximation of an infinite loop. for(;;){ if(condition) break; }
- yuubi 10y agoYes, that looks exactly analogous, but my question is why people don't use the perfectly good built-in conditional termination in a while or for loop and instead add on an if statement. (Also, I don't understand why a for(;;) loop is more attractive than a while(1) loop.)