首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

java 实施shell 脚本 返回 find的内容~

2013-07-20 
java 执行shell 脚本 返回 find的内容~~如题:java 执行shell 脚本 返回 find的内容~~find.sh 内容为:#!/bi

java 执行shell 脚本 返回 find的内容~~
如题:

     java 执行shell 脚本 返回 find的内容~~

 

    find.sh 内容为:

    #!/bin/sh

    source /etc/profile;

    find . -name "*2013-04-14*" |xargs grep cn="123@qq.com"


   直接执行脚本,可以打印出数据。但是在JAVA代码中:

    Process  child=Runtime.getRuntime().exec(pathshell+"/find.sh");

    final InputStream inputStream = child.getInputStream();
    final BufferedReader brOut = new BufferedReader(new InputStreamReader(inputStream));

    却没有内容~~  这是为什么?要怎么才能把find 的内容获取到呢???
java shell find 返回数据 脚本
[解决办法]
加入页面阻塞,试试。例如在页面中 加入sleep

热点排行