Skip to content Skip to sidebar Skip to footer

SBCL Run Shell Command

I've seen Executing a shell command from Common Lisp and its answers, but I'm still not sure whether SBCL provides a way execute shell commands from code. The SBCL Manual does supp

Solution 1:

Given the file test.py:

import sys
sys.exit(42)

You can run it with sb-ext:run-program and examine the exit code as follows:

CL-USER> (sb-ext:run-program "python" '("test.py") :search t :wait t)
#<SB-IMPL::PROCESS :EXITED 42>
CL-USER> (sb-ext:process-exit-code *)
42

Post a Comment for "SBCL Run Shell Command"