SBCL Run Shell Command
Question: I've seen [Executing a shell command from Common
Lisp](http://stackoverflow.com/q/6065446/1281433) and its answers, but I'm
still not sure whether SBCL provides a way execute shell commands from code.

The [SBCL Manual](http://www.sbcl.org/manual/#sb_002dposix) does support
POSIX, but I was hoping for something a bit more higher level. Specifically, I
want to call a Python script and capture the return value. Is there any way to
do this?


Answer: 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
    

