0

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.

vishnu
  • 891
  • 2
  • 11
  • 20

2 Answers2

1

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

guile -c '(display (+ 1 2 3 4)) (newline)' > output
Michael Vehrs
  • 3,293
  • 11
  • 10
0

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

Community
  • 1
  • 1
vishnu
  • 891
  • 2
  • 11
  • 20