title: how to write a process-pool bash shell
body: <p>I have more than 10 tasks to execute, and the system restrict that there at most 4 tasks can run at the same time.</p>
  
  <p>My task can be started like:
  myprog taskname</p>
  
  <p>How can I write a bash shell script to run these task. The most important thing is that when one task finish, the script can start another immediately, making the running tasks count remain 4 all the time.</p>