title: Libraries to run unix commands from Java
body: <p>I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include:</p>
  
  <ol>
  <li>Running multiple commands.</li>
  <li>Capture output for previous command.</li>
  <li>Take some action/Run different command based on output of last command.</li>
  </ol>
  
  <p>Any pointers will be appreciated.</p>