Created
January 2, 2016 09:35
-
-
Save JoshuaChi/39a6787c0f06a51f96ec to your computer and use it in GitHub Desktop.
Shell Multi Process
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
#!/bin/bash | |
set -m # Enable Job Control | |
WORKSPACE="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )" | |
for i in `seq 8`; do # start 8 jobs in parallel(e.g. 8 cores) | |
//sh example.sh | |
done | |
# Wait for all parallel jobs to finish | |
while [ 1 ]; do fg 2> /dev/null; [ $? == 1 ] && break; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment