On Debian, how to run a given command COMMAND when another (like `sleep 5`) starts?
Yesterday 3:52pm
To run a command (COMMAND) when another command (like sleep 5) starts on Debian (or any Linux system), you can use a combination of shell features. Here are two approaches:
1. Using & and wait in a Shell Script
If you want COMMAND to run immediately when sleep 5 starts, you can use backgrounding (&) and a subshell: