当前页面: 开发资料首页 → J2SE 专题 → readline的问题
readline的问题
摘要: readline的问题
为什么执行到readline的时候就死机了。
代码如下:
child = Runtime.getRuntime().exec("su axadmin -c 'crontab -l' ");
BufferedReader in = new BufferedReader(new InputStreamReader(child.getInputStream()));
String str = null;
while ( (str = in.readLine()) != null) {
System.out.println(str) ;
out.write(str);
out.write('/n');
}
in.close();
请问大侠们这段代码有什么出错?
如果换成child = Runtime.getRuntime().exec("crontab -l");就不会死机。
crontab的问题?
不懂unix啊
crontab-1[user]-列出用户目前的crontab
su axadmin -c 'crontab -l'
切换用户 然后执行 crontab 的shell语句是这样的吗
我无语,大家都在灌水吧?
这是技术贴,和水无关。
没有灌水吧
我估计是它等待你输入密码之类的
mark
take back my mark.