trivial-shell
Trivial shell is a simple platform independent interface to the underlying Operating System. It forks and builds on the code in Kevin Rosenberg's handy KMRCL tools. More details can be found on its home page at Common-Lisp.net. Presently, the package is quite rudimentary (even for something trivial!) but we all live in hope.

NB: These days you might prefer inferior-shell for its wider support and richer interface.

Quick assessment (2024-03-24)

Let's see what we've got to work with:

> (apropos 'run :mkcl)
RUN-COMMAND  Function
RUN-PROGRAM-1  Function
RUN-PROGRAM  Function
GET-INTERNAL-RUN-TIME  Function
FTRUNCATE  Function
TRUNCATE  Function
GET-INTERNAL-RUN-TIME  Function
FTRUNCATE  Function
TRUNCATE  Function

Here we have mkcl:run-command, which is what's used by compiler::run-command to call out to GCC. On Windows, it uses CreateProcessW, whereas on Unix, it uses either execv(3) or execvp(3). There's also mkcl:system, which corresponds to system(3) and it's what uiop:run-program uses when :force-shell t is specified. If we use mkcl:run-program, then trivial-shell::%shell-command will look like this:

(defun trivial-shell::%shell-command (command input) (trivial-shell::with-input (input-stream (or input :none)) (multiple-value-bind (two-way-stream shell-process exit-status) (mkcl:run-program trivial-shell::*bourne-compatible-shell* (list "-c" command) :input input-stream :output :stream :error :stream :wait t) ;; Grab everything from the ERROR and OUTPUT streams. (let* ((error-stream (mkcl:process-error shell-process)) (output (trivial-shell::file-to-string-as-lines two-way-stream)) (error (trivial-shell::file-to-string-as-lines error-stream))) (close two-way-stream) (close error-stream) (values output error exit-status)))))

Clearly, the option :wait t (the default) depends on whether the command is run interactively or is expected to return immediately.


MIT-LICENSE