title: What is the right command format for Java ProcessBuilder sudo bash command?
body: <p>How to execute a command like this (with sudo) from Java ProcessBuilder? (I do not need to include a password because the normal user has permission to run myscript.log as root without a password.)</p>
  
  <pre><code>sudo bash /home/me/path/myscript.sh arg1 arg2 arg3 &gt;&gt; /var/log/path/myscript.log 2&gt;&amp;1
  </code></pre>
  
  <p>My question is how do the elements of this command get passed into the constructor of Java's <code>ProcessBuilder</code>?</p>
  
  <p>For example, is "sudo" the first argument to the <code>ProcessBuilder</code> ctor, the last, or somewhere else? And how do you know where they go and which elements of the command become arguments to <code>ProcessBuilder</code>?</p>