CLISP: Returning stdout, stderr, and retcode from a shell command CLISP: Returning stdout, stderr, and retcode from a shell command shell shell

CLISP: Returning stdout, stderr, and retcode from a shell command


run-program returns multiple values.You can handle them as explained in the linked question.

The doc you link to says:

If :STREAM was specified for :INPUT or :OUTPUT, a Lisp STREAM is returned. If :STREAM was specified for both :INPUT and :OUTPUT, three Lisp STREAMs are returned, as for the function EXT:MAKE-PIPE-IO-STREAM.

Thus what you need is either

(EXT:MAKE-PIPE-IO-STREAM "ls")

or

(ext:run-program "ls" :input :stream :output :stream)

Then you will have to read from the streams returned to get the command output. However, in this case you will lose the exit code.