Last active
July 10, 2020 15:34
-
-
Save talhanai/14229fb24e281d0eccb2559c91437bfa to your computer and use it in GitHub Desktop.
An example for running a list of bash commands in parallel, while monitoring progress.
This file contains hidden or 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
| #!/bin/bash | |
| # Create list of bash commands to execute | |
| echo "echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5; | |
| echo "hello"; sleep 5;" > file.txt | |
| # Process list of bash command in parallel, while tracking progress and ETA. | |
| num_jobs_in_parallel=3 | |
| parallel --bar --eta -j ${num_jobs_in_parallel} < file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment