Created
September 2, 2011 10:05
-
-
Save smerrill/1188307 to your computer and use it in GitHub Desktop.
Run a list of commands (one per line) with a certain concurrency.
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
cat big_list_of_commands.txt | tr '\n' '\0' | xargs -0 -n1 -P{thread-count} bash -c | |
# or, per the example given: | |
(for i in 1 2 3 4 5 6 7 8 9 10; do echo "echo 'Delay $i'; sleep $i ; echo 'Done $i'" ; done) | tr '\n' '\0' | xargs -0 -n1 -P4 bash -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment