public static int transfrom (String id){

Process process =null;

//pro1等语句自定义自己要执行的语句用&&符号连接 按照先后顺序执行    /bin/sh  -c 是不变的

String[] command1 = new String[]{
"/bin/sh","-c",pro1+" && "+pro2+" && "+pro3+" && "+delete1+"&&"+delete2+" && "+delete3+" && "+delete4
};


try {
process = Runtime.getRuntime().exec(command1);
process.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return 100;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return 100;
}

return 0;

}

posted on 2017-08-15 17:04  大峰1992  阅读(453)  评论(0编辑  收藏  举报