title: Running multiple background processes through shell scripting
body: <p>I'm new to shell scripting, so pardon my lack of knowledge.</p>
  
  <p>My aim is to run two servers <code>server1</code> and <code>server2</code> in the background and then run a python script <code>scriptRun</code> through my shell script.</p>
  
  <p>Step1: </p>
  
  <ul>
  <li><p>Launch server1 (making it run in the background)</p></li>
  <li><p>Run a few commands on this server (which are customized commands)</p></li>
  </ul>
  
  <p>Step2:</p>
  
  <ul>
  <li>Launch server2</li>
  </ul>
  
  <p>Step3:</p>
  
  <ul>
  <li>Run my python script and display its output on the terminal after server1 and server2 are launched</li>
  </ul>
  
  <p>My shell script looks like this:</p>
  
  <pre><code>echo "Launching server1"
  java StartServer1.jar &amp;&amp; (serverCommand1 &amp;&amp; serverCommand2) &amp;
  
  echo "Launching server2"
  java StartServer2.jar &amp;&amp;
  
  echo "Running script"
  python scriptRun.py
  </code></pre>
  
  <p>This script does not work at all.
  I tried removing the serverCommand1 and serverCommand2, this works, but the python script does not wait for server2 to launch.</p>
  
  <p>Also the terminal displays the outputs of server1 and server2, and not the output of the python script. </p>
  
  <p>My question is how do I run multiple processes in the background and run another process which is dependent on the previous processes?</p>