Common lisp 如何获取shell函数';粘液的产量是多少?

Common lisp 如何获取shell函数';粘液的产量是多少?,common-lisp,clisp,Common Lisp,Clisp,在REPL中,我们可以正常获得其输出: (shell "head -3 ~/misc.lisp") (asdf:make-build 'stumpwm :type :program :monolithic t :move-here "." :name-suffix "" 然而,我们从slime中的(shell“head-3~/misc.lisp”)中得到了零 真诚的 我不知道您使用的是哪个Lisp实现,但通常您需要一个包来运行shell命令,

在REPL中,我们可以正常获得其输出:

(shell "head -3 ~/misc.lisp")
(asdf:make-build 'stumpwm :type :program :monolithic t
             :move-here "."
             :name-suffix ""
然而,我们从slime中的
(shell“head-3~/misc.lisp”)
中得到了零


真诚的

我不知道您使用的是哪个Lisp实现,但通常您需要一个包来运行shell命令,如:

  • (构建在普通外壳之上)
使用#'run-shell-command代替shell:

(let ((str (ext:run-shell-command cmd :output :stream)))
    (loop  for line = (read-line str  nil)
        until (null line)
        do (print line)))
现在可以了