I've been trying to learn Common Lisp with SBCL and I've ran into issues executing my code. Everything works fine using sbcl --script exec.lisp
(regardless of if I have specified a shebang line) but I can't seem to execute the same file with a shebang line directly as ./exec.lisp
. While I've most likely misunderstood something the manual does from my understanding imply that this should be possible. My exec.lisp
script looks identical to the one in the example (and it has been given executable privileges chmod a+x exec.lisp
)
#!/usr/local/bin/sbcl --script
(write-line "Hello, World!")
but instead of the desired output I receive :
$ ./exec.lisp
./exec.lisp: line 2: write-line: command not found
I've made sure that the path to sbcl
is correct)
EDIT: I'm using mac OS.
had same problem on MacOS, changed to:
#!/usr/bin/env sbcl --script
worked.
Using GNU Core Utilities on Arch Linux here:
#!/usr/bin/env -S sbcl --script
(write-line "😻")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With