Last active
October 18, 2016 03:36
-
-
Save pocari/991bd017b1015a22f9691aa86a6962aa to your computer and use it in GitHub Desktop.
xargsでパラレル実行
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/sh | |
# seq 1 4 | xargs -I REP -P 4 ./pdispatcher.sh \REP | |
# => process a | |
# => process b | |
# => process c | |
# => process d | |
case $1 in | |
"1" ) sleep 1 && echo process a ;; | |
"2" ) sleep 1 && echo process b ;; | |
"3" ) sleep 1 && echo process c ;; | |
"4" ) sleep 1 && echo process d ;; | |
* ) echo unknown pattern $1 && exit 1 | |
esac | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment