Advertisement
zamotivator

Untitled

Feb 27th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. function parallel ()
  2. {
  3.     echo "parallel [${a_platform[*]}] executing '$@'"
  4.     local i=0
  5.     local e=${#a_platform[@]}
  6.     local c;
  7.     while [ ${i} -lt ${e} ]; do
  8.     c=${a_platform[${i}]}
  9.     ${@} ${c} &
  10.     echo "parallel [${c}] [$((i+1))/${e}] started"
  11.     i=$(( i + 1 ));
  12.     done;
  13.     echo "parallel [${a_platform[*]}] waiting '$@'"
  14.     wait
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement