Run and stop multiple long-running commands from Bash with a trap
Link – – liamhammett.com
Liam Hammett explains how you can use the trap
command to stop multiple bash process in one go.
Sometimes when working on a project, I’ll always want to run a handful of commands at the same time, some of which may return when they’re done, others might be long-running, like watchers or services actively exposing ports. This is something that might seem simple to do with a basic Bash script at first, but what if your script has multiple processes running side-by-side and you want to be able to stop them all at once too?
Read more [liamhammett.com]
What are your thoughts on "Run and stop multiple long-running commands from Bash with a trap"?