Rovanion
Rovanion

Reputation: 4582

Capture stdout of Guile system call

If I in a GNU Guile REPL run

(define a (system "ls"))
Desktop  Dokument...

a holds the exit status of ls, i.e. 0.

a
$7 = 0

But how would I go about using the output (stdout) of the command? The function system* seems to work the same way.

The question Execute command-line from Scheme asks how to execute a command using any method. This question is specifically about the function system and how to capture the output of a program run through it.

Upvotes: 0

Views: 47

Answers (0)

Related Questions