无法在Ubuntu中运行SBCL-Common-Lisp SB-EXT:RUN-PROGRAM

问题描述 投票:1回答:2

我注意到这个问题,当我试图在程序中运行一个功能,显然在shell中运行的东西,我得到了这个错误:

Couldn't execute "/bin/csh": No such file or directory
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME interactive evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "worker" RUNNING {10062173C3}>)

Backtrace:
  0: (SB-EXT:RUN-PROGRAM "/bin/csh" ("-fc" "timidity tst.midi") :ENV NIL :ENVIRONMENT NIL :WAIT NIL :SEARCH NIL :PTY NIL :INPUT NIL :IF-INPUT-DOES-NOT-EXIST NIL :OUTPUT NIL :IF-OUTPUT-EXISTS :ERROR :ERROR ..

等等 ...

然后我尝试直接运行SB-EXT:RUN-PROGRAM函数并再次出现以下错误:

(SB-EXT:RUN-PROGRAM "ls" (list "-l"))

Couldn't execute "ls": No such file or directory
   [Condition of type SIMPLE-ERROR]

有谁知道问题是什么以及sbcl如何找到他需要的命令?

shell command-line common-lisp csh sbcl
2个回答
1
投票

这很可能是因为程序试图运行一个你没有安装的shell而不是/bin/sh这是一个POSIX要求。最好的解决方法是更新代码以使用/bin/sh,但是如果你的ubuntu-box上有root,你可以像这样安装它:

sudo apt-get install tcsh

这会安装一个稍微好一点的shell,它与csh兼容。安装/bin/csh后存在。要找出你的程序,你可以运行man csh


1
投票

您也可以使用zsh或bash进行切换。它适用于在Ubuntu上运行的SBCL:

(SB-EXT:RUN-PROGRAM "ls" (list "-l") 
             :search "/usr/bin/zsh" 
             :output *standard-output*)
© www.soinside.com 2019 - 2024. All rights reserved.