Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just in case a shorter version appeals to you, I think you could rewrite it like this:

  timeout 60 bash -c 'until is_ready; do sleep 10; done'
You'll need to `export -f is_ready` if it's a shell function. That's assuming you can use a timeout instead of number-of-retries.

http://man7.org/linux/man-pages/man1/timeout.1.html



I was trying to find the source of where I got that bash script from, but couldn't, and then forgot about it within the editing window.

I'll try to find it and provide that feedback. Thanks!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: