I want to create two process in Guile and send the output (stdout) from one of them as input (stdin) to the other.
Using the following example, how can this be done?
echo "foo bar" | wc
Output:
1 2 8
I want to create two process in Guile and send the output (stdout) from one of them as input (stdin) to the other.
Using the following example, how can this be done?
echo "foo bar" | wc
Output:
1 2 8
Yes, you can do this using
open-output-pipe
:This is equivalent to
echo "The quick brown fox jumps over the the lazy dog." | wc
(includingecho
's implicit newline because I'm that particular, lol).There is, of course, an
open-input-pipe
analogue. Read the Pipes section of the Guile manual for more details.