📜  使用参数启动 shell 脚本的 Java 代码 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:16.051000             🧑  作者: Mango

代码示例1
String cmd= "./copyFile.sh file1Name file2Name" ; // Path to Script and paramters $1 $2 used inside the script
ProcessBuilder pb = new ProcessBuilder(cmd. split(" ")); 
Process pr = pb.start();