vishnu
vishnu

Reputation: 920

How to Write scheme shell results to a file?

I am executing some commands in guile shell. I want the results of the command written to a file.

I tried something like this:

some command | nc localhost abc >> file.txt 

But did not work for me.

Upvotes: 0

Views: 182

Answers (2)

vishnu
vishnu

Reputation: 920

I tried the following and it worked.

echo  -e "(define out (open-output-file \"/opt/ncOutput.txt\"))\n(display \"hello world\" out)\n(close-output-port out)\n" | nc localhost abc

IO operations with Guile

Upvotes: 0

Michael Vehrs
Michael Vehrs

Reputation: 3363

You need to display the results, in order to redirect them:

guile -c '(display (+ 1 2 3 4)) (newline)' > output

Upvotes: 1

Related Questions