我们能在java中自动化CLI (命令行接口)吗?请建议如何实现这一目标。基本上,我需要逐个读取excel文件中的命令,用Java执行命令并复制输出结果。
发布于 2017-07-14 04:52:28
使用ProcessBuilder创建进程。
有关教程,请参阅这。
例如:
ProcessBuilder pb = new ProcessBuilder("echo", "Echo Example");
Process process = pb.start();
\\you can use the process.getInputStream() to get the console output.https://stackoverflow.com/questions/45094663
复制相似问题