How to create Multiple Threads in Bash Shell Script
<p>I have a an array of arguments that will be utilized as such in the command for my shell script. I want to be able to do this</p>

<pre><code>./runtests.sh -b firefox,chrome,ie
</code></pre>

<p>where each command here will start a separate thread (currently we are multithreading by opening multiple terminals and starting the commands there)</p>

<p>I have pushed the entered commands into an array:</p>

<pre><code>if [[ $browser == *","* ]]; then
    IFS=',' read -ra browserArray &lt;&lt;&lt; "$browser"
fi
</code></pre>

<p>Now I will have to start a separate thread (or process) while looping through array. Can someone guide me in the right direction? My guess in sudo code is something like</p>

<pre><code>for (( c=0; c&lt;${#browserArray}; c++ ))
    do
    startTests &amp;
</code></pre>

<p>Am I on the right track?</p>