title: how to wait wget finished to get more resources
body: <p>I am new to bash.</p>
  
  <p>I want to wget some resources in parallel. </p>
  
  <p>What is the problem in the following code: </p>
  
  <pre><code>for item in $list
  do
    if [ $i -le 10 ];then
      wget -b $item
      let "i++"
    else
      wait
      i=1
    fi
  </code></pre>
  
  <p>When I execute this shell. Error throwed:</p>
  
  <pre><code>fork: Resource temporarily unavailable
  </code></pre>
  
  <p>My question is how to use wget right way.</p>
  
  <h2>Edit:</h2>
  
  <p>My problem is there is about four thousands of url to download, if I let all these jobs work in parallel, fork: Resource temporarily unavailable will throw out. I don't know how to control the count in parallel.</p>