Java Run Shell Script
来源:互联网 发布:只有我知大结局 编辑:程序博客网 时间:2024/05/18 12:35
private int runShellScript(String strShellScript) { try { LOGGER.info("Ready to run {}", strShellScript); Process process = Runtime.getRuntime().exec(strShellScript); BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = ""; while ((line = input.readLine()) != null) { LOGGER.info(line); } input.close(); int exitValue = process.waitFor(); if (0 != exitValue) { LOGGER.error("call shell failed, error code is {}", exitValue); } return exitValue; } catch (Throwable e) { LOGGER.error("call shell failed {}", e); return -1; } }
阅读全文
0 0
- Java Run Shell Script
- Error: run custom shell script
- dalvikvm run the java jar script
- HowTo: Run the .sh File Shell Script In Linux / UNIX
- run custom shell script '[cp] copy pods resource
- How to execute shell script in Java?
- shell Script
- shell script
- Shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- Shell Script
- Hadoop日志存放路径详解
- 歌唱比赛C++
- ionic注册安卓物理返回键的处理方法
- 寻找字符串里第一个只出现过一次的字符
- Django REST framework实现关键词检索
- Java Run Shell Script
- 【清华集训2017模拟】ces
- 四轴飞行器的位置式PID控制和增量式PID控制
- JavaScript权威指南读书笔记——第十六章 脚本化CSS
- 正则
- java 进程和线程介绍(Thread,Runnable)
- hdu6144(模拟)
- 城市名称查询
- 点击一个超链接,弹出固定大小的新窗口(js实现)