Created
July 8, 2023 11:27
-
-
Save gmolveau/1367c05762140ec2e02a24f1282abb3d to your computer and use it in GitHub Desktop.
bash run multiple commands in parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source : https://stackoverflow.com/a/52033580 | |
# the wait allows COMMAND2 to finish before COMMAND1 | |
# the trap allows the user to kill all the commands with one control-c | |
(trap 'kill 0' SIGINT; COMMAND1 & COMMAND2 & wait) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment