clojure海螺';s shell api没有';不显示外部命令(如java)的结果

clojure海螺';s shell api没有';不显示外部命令(如java)的结果,shell,clojure,Shell,Clojure,我想在我的项目上使用clojure脚本进行开发任务,比如使用clojure脚本运行项目等等 我为shell api使用了和clojure-conch库,脚本如下(dubofsky.clj) 但是在leinoneoffdubofsky.clj上,它似乎没有打印外部命令的输出,例如java,grails等 上述脚本的结果是 $ lein oneoff --exec devops.clj .................................... Project starting...

我想在我的项目上使用clojure脚本进行开发任务,比如使用clojure脚本运行项目等等

我为shell api使用了和clojure-conch库,脚本如下(
dubofsky.clj

但是在
leinoneoffdubofsky.clj
上,它似乎没有打印外部命令的输出,例如
java
grails

上述脚本的结果是

$ lein oneoff --exec devops.clj 
....................................
Project starting...
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$lein oneoff--exec devops.clj
....................................
项目正在启动。。。
GNUBash,版本4.3.11(1)-发行版(x86_64-pc-linux-GNU)
版权所有(C)2013免费软件基金会。
许可证GPLv3+:GNU GPL版本3或更高版本
这是自由软件;您可以自由更改和重新分发它。
在法律允许的范围内,不存在任何担保。

Shell进程有两个定义的输出流,stdout和stderr。你只不过是在抓捕stdout。
java-version
命令不打印到stdout,它只打印到stderr

user> (print (shell/stream-to-string (shell/proc "java" "-version") :out))
nil
user> (print (shell/stream-to-string (shell/proc "java" "-version") :err))
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
nil
user> (print (shell/stream-to-string (shell/proc "java" "-version") :out))
nil
user> (print (shell/stream-to-string (shell/proc "java" "-version") :err))
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
nil