Skip to content

Instantly share code, notes, and snippets.

@chazlever
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chazlever/2e2a27c86fcfddb80894 to your computer and use it in GitHub Desktop.
Save chazlever/2e2a27c86fcfddb80894 to your computer and use it in GitHub Desktop.
parallel-whale.sh
PORT_NUM=50001
MAX_PROCESSES=0
for fn in $(ls /path/to/single/line/files); do
./run_user_profile.sh $fn $PORT_NUM $(basename $fn) &
MAX_PROCESSES=$((MAX_PROCESSES + 1))
PORT_NUM=$((PORT_NUM + 1))
if [ $MAX_PROCESSES -gt 10 ]; then
wait
MAX_PROCESSES=0
fi
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment