Zend certified PHP/Magento developer

running simultaneous ssh session

I am running a script to simultenously run ssh sessions to 100 elements but my server can only permit 10 elements to be accessed at a time. How can I modify my script to run the 100 elements by dividing it to 10 per session, making 10 sessions inside the script. My script is like below:


cat ip | while read ip
do
connect.sh $ip >> ip.OK &
done


connect.sh is the main script to shh to all IPs and run a specific command.

appreciate any help in learning scripting.

regards,
TripleHar