Run python commands in parallel in Linux shell scripting
<p>I have a script which gets input from the user through command line arguments. It processes the arguments and starts running python commands. For Example:</p>

<pre><code>./run.sh p1 p2 p3 p4
python abc.py p1 p4
python xyz.py p2 p3 
</code></pre>

<p>where <code>p1</code>, <code>p2</code>, <code>p3</code> and <code>p4</code> can be of any type. </p>

<p>I need to run both of these python commands in parallel and in two different terminals. How can I do it so that I don't need to wait for 1 command to finish in order to start the next command?</p>

<p>I tried GNU parallel but it doesn't seem to work. </p>

<p>Try running each process in the background by adding <code>&amp;</code> to the end of the command.</p>

<pre><code>python abc.py p1 p4 &amp;

python xyz.py p2 p3 &amp;
</code></pre>

<p><a href="http://www.hacktux.com/bash/ampersand" rel="nofollow">Some Info</a></p>

python linux shell