Two methods of executing arbitrary commands in Runime.getRuntime () .exec & # 40
It is often found that you need to pass parameters in an array to execute certain commands:
The reason is that when executing multiple arguments, spaces are treated as delimiters, so your command line is treated as multiple arguments:
Solution 1:
Use ${IFS}, for example:
Echo "a ${IFS} a ${IFS} a"
Solution 2:
Add the following instruction before the shell instruction you want to execute:
Sh-c $@ | sh. Echo