try {
// /opt/assets/newping/bin/detectping.sh 10.1.1.199 ,100.1.11.183
//脚本路径
String command=shPath+"bin/detectping.sh "+n_ip_address ;
// String command=shPath+"bin\\detectping.sh "+n_ip_address ;
Process process = Runtime.getRuntime().exec(command);
BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = "";
//获取返回的数据
while ((line = read.readLine()) != null) {
lstRetData.add(line);
}
read.close();
try {
process.waitFor();//等待子进程完成再往下执行。
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}