JAVA调用系统命令不支持管道
技术传播 2010-03-29 08:58:22 JAVA在调用系统命令的时候不支持命令管道吗?
为什么我执行ps aux的时候成功返回想要的结果而执行ps aux|grep mysql的时候就不成功?
我的代码是这样写的:
Runtime r = Runtime.getRuntime();
Process p = null;
try {
p = r.exec(command);
} catch (IOException e) {
e.printStackTrace();
}