1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: Operating System utilities
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Jul 2003
12 ;;;; *************************************************************************
16 (defun run-shell-command (control-string &rest args)
17 "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
18 synchronously execute the result using a Bourne-compatible shell,
19 returns (VALUES string-output exit-code)"
20 (let ((command (apply #'format nil control-string args)))
22 (sb-impl::process-exit-code
26 :input nil :output nil))
29 (ext:process-exit-code
33 :input nil :output nil))
36 (multiple-value-bind (output dummy exit)
37 (excl:run-shell-command command :input nil :output :stream
39 (declare (ignore dummy))
43 (system:call-system-showing-output
46 :output-stream output)
48 #+clisp ;XXX not exactly *verbose-out*, I know
49 (ext:run-shell-command command :output :terminal :wait t)
53 (ccl:external-process-status
54 (ccl:run-program "/bin/sh" (list "-c" command)
55 :input nil :output nil
58 #-(or openmcl clisp lispworks allegro scl cmu sbcl)
59 (error "RUN-SHELL-PROGRAM not implemented for this Lisp")