Create README.md
[trivial-shell.git] / dev / cmucl.lisp
blob3a6c57f9ac7a15f9a9b9a2b0784f4c9fef051fd0
1 (in-package #:trivial-shell)
3 (defun %shell-command (command input)
4 (let* ((process (ext:run-program
5 *bourne-compatible-shell*
6 (list "-c" command)
7 :input input :output :stream :error :stream))
8 (output (file-to-string-as-lines (ext::process-output process)))
9 (error (file-to-string-as-lines (ext::process-error process))))
10 (close (ext::process-output process))
11 (close (ext::process-error process))
13 (values
14 output
15 error
16 (ext::process-exit-code process))))
18 (defun %os-process-id ()
19 (error 'unsupported-function-error :function 'os-process-id))
21 (defun %get-env-var (name)
22 (cdr (assoc (intern (substitute #\_ #\- name)
23 :keyword)
24 ext:*environment-list*)))
26 (defun %exit (code)
27 (unless (zerop code)
28 (error "CMUCL does not support exit codes."))
29 (ext:quit t))