title: Shell script for running multiple processes
body: <p>I have a question regarding shell scripts (the environment is Linux, preferably Ubuntu).</p>
  
  <p>We want to execute a stress test on a RESTFul application. The stress test is composed of two processes. Running them could be something like: </p>
  
  <p>java -jar stress.jar</p>
  
  <p>java -jar stress.jar -someparameter somevalue</p>
  
  <p>The two have to be started at the same time.</p>
  
  <p>The first process should start, run, and return. The second too. By definition the second will return much earlier, and we want it to be repeatedly executed until the first one returns.</p>
  
  <p>I would be very thankfor if somebody can provide me the script (or the basics that I can use) for this to achieve.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>this did the trick:</p>
  
  <pre><code>#!/bin/bash
  
  commandA &amp; apid=$!; 
  
  sleep 10;
  
  while kill -0 $apid; do commandB; done
  </code></pre>