Skip to content

Instantly share code, notes, and snippets.

@gmolveau
Created July 8, 2023 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmolveau/1367c05762140ec2e02a24f1282abb3d to your computer and use it in GitHub Desktop.
Save gmolveau/1367c05762140ec2e02a24f1282abb3d to your computer and use it in GitHub Desktop.
bash run multiple commands in parallel
# 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