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.)
sudo bash /home/me/path/myscript.sh arg1 arg2 arg3 >> /var/log/path/myscript.log 2>&1
My question is how do the elements of this command get passed into the constructor of Java's ProcessBuilder
?
For example, is "sudo" the first argument to the ProcessBuilder
ctor, the last, or somewhere else? And how do you know where they go and which elements of the command become arguments to ProcessBuilder
?