How to write results from guile shell to a file?

36 views
Skip to first unread message

Vishnu Priya

unread,
Apr 5, 2017, 4:12:15 PM4/5/17
to opencog
Hello all,

I just want to write the output of  (nlp-parse "This is a test.") to a file.
So i tried like this, 

echo "(nlp-parse \"This is a test.\")" | nc localhost 17004 > file.txt
 
 But i got only the following in the file and not the expected SentenceNode. 

[0;34mguile [1;34m> [0m [0;32mopencog [1;32m> [0mEntering scheme shell; use ^D or a single . on a line by itself to exit.
[0;34mguile [1;34m> [0m

How can i do this?


Thanks,
Vishnu



Vishnu Priya

unread,
Apr 6, 2017, 6:19:23 AM4/6/17
to opencog

 I tried like this and it worked !! :-)

echo  -e "(define out (open-output-file \"/opt/opencog/file.txt\"))\n(write (nlp-parse \"hello world.\") out)\n(close-output-port out)\n" | nc localhost 17004

Cheers,
Vishnu 

Linas Vepstas

unread,
Apr 6, 2017, 11:10:15 AM4/6/17
to opencog
That's exactly it!  --linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/460f5996-fedf-4f32-813d-0a731641db21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages