How to execute such a command (using sudo) from Java ProcessBuilder? (I do not need to include a password, because a regular 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 are the elements of this command passed to the Java constructor ProcessBuilder?
For example, "sudo" is the first argument to ProcessBuilderctor, last or somewhere else? And how do you know where they are going, and what elements of the team become arguments for ProcessBuilder?
source
share