Bli*_*ink 6 sbcl common-lisp shebang
我一直在尝试使用 SBCL 学习 Common Lisp,但在执行我的代码时遇到了问题。使用sbcl --script exec.lisp(无论我是否指定了 shebang 行)一切正常,但我似乎无法使用 shebang 行直接执行相同的文件作为./exec.lisp. 虽然我很可能误解了手册所做的事情,但根据我的理解,这意味着这应该是可能的。我的exec.lisp脚本看起来与示例中的脚本相同(并且它已被授予可执行权限chmod a+x exec.lisp)
#!/usr/local/bin/sbcl --script
(write-line "Hello, World!")
Run Code Online (Sandbox Code Playgroud)
但我收到的不是所需的输出:
$ ./exec.lisp
./exec.lisp: line 2: write-line: command not found
Run Code Online (Sandbox Code Playgroud)
我已经确保路径sbcl是正确的)
编辑:我使用的是 mac OS。