https://github.com/joymon/shell-run-parallel-then-wait
Shell script demonstrating how commands can be executed in parallel and wait for all
https://github.com/joymon/shell-run-parallel-then-wait
Last synced: 5 months ago
JSON representation
Shell script demonstrating how commands can be executed in parallel and wait for all
- Host: GitHub
- URL: https://github.com/joymon/shell-run-parallel-then-wait
- Owner: joymon
- License: mit
- Created: 2024-06-11T16:12:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-10T13:31:16.000Z (over 1 year ago)
- Last Synced: 2025-01-30T23:32:16.156Z (12 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Running commands in parallel then wait for completion in shell script
Shell script demonstrating how commands can be executed in parallel and wait for all to do next actions
# Run
- Clone the repo
- Execute the runner.sh
# Advanced scenarios
Below snippet for `runner.sh` to execute 2 commands in sequence in parallel with other block that has 2 serial steps. The command after teh wait executes only after all the above parallel steps.
```shell
{ ./counter.sh 1 10 ; ./counter.sh 11 20; } &
{ ./counter.sh 21 30 ; ./counter.sh 31 40; } &
wait
./counter.sh 41 50
```