Get the latest tech news
TIL: timeout in Bash scripts
How to use the `timeout` command to terminate processes after a specified time and how to combine it with `until` for smarter shell scripting.
The other day at work we had a Bash script that would set up a web server and wait for it to be up before proceeding to the next things. The script worked fine and we had no issues, until we had an infinite loop. timeout expects a killable command and until is a shell keyword: you can’t SIGTERMuntil.
Or read this on Hacker News