title: Shell Scripting: Using xargs to execute parallel instances of a shell function
body: <p>I'm trying to use xargs in a shell script to run parallel instances of a function I've defined in the same script. The function times the fetching of a page, and so it's important that the pages are actually fetched concurrently in parallel processes, and not in background processes (if my understanding of this is wrong and there's negligible difference between the two, just let me know).</p>
  
  <p>The function is:</p>
  
  <pre><code>function time_a_url ()
  {
       oneurltime=$($time_command -p wget -p $1 -O /dev/null 2&gt;&amp;1 1&gt;/dev/null | grep real | cut -d" " -f2)
       echo "Fetching $1 took $oneurltime seconds."
  }
  </code></pre>
  
  <p>How does one do this with an xargs pipe in a form that can take number of times to run time_a_url in parallel as an argument? And yes, I know about GNU parallel, I just don't have the privilege to install software where I'm writing this.</p>