Capturing output from `system'

From: Christian Lynbech <lynbech_at_daimi.aau.dk>
Date: Tue, 17 Oct 1995 11:30:12 GMT

Is it possible to capture the output from commands run through
`system'. The obvious solution of

        (with-output-to-string (lambda () (system command)))

does not seem to work in STk 2.2 (SGI, Irix 5.3).

I know of `exec' but then I loose the return value of the command and
using `run-process' does not seem to change anything.


Is there any way I can get the combined effects of `system' (return
value) and `exec' (process output)? Or must I do some trickery with
`exec', getting the shell-command to include the sub-command status in
the output.


---------------------------+--------------------------------------------------
Christian Lynbech | Computer Science Department, University of Aarhus
Office: R0.32 | Ny Munkegade, Building 540, DK-8000 Aarhus C
Phone: +45 8942 3217 | lynbech_at_daimi.aau.dk -- www.daimi.aau.dk/~lynbech
---------------------------+--------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic_at_hal.com (Michael A. Petonic)
Received on Tue Oct 17 1995 - 12:33:06 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST