chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] capture command output


From: Jinsong Liang
Subject: [Chicken-users] capture command output
Date: Wed, 10 Jul 2013 10:52:55 -0400

Sorry if this is a question answered before.

How can I capture the output of a shell command?

I found the follow code from google but it seems not working. The output still goes to stdout.

(define (system/output command-string)                                                          
  (let ([p (open-output-string)])                                                               
    (parameterize ([current-output-port p])                                                     
                  (if (system command-string)                                                   
                    (get-output-string p)                                                       
                    #f))))

Thank you!

Jinsong

reply via email to

[Prev in Thread] Current Thread [Next in Thread]