How to signal EOF to Erlang shell program on OSX and in general

11 views
Skip to first unread message

Rick O'Shea

unread,
Aug 13, 2017, 3:04:38 PM8/13/17
to Erlang Questions
Requirement: accumulate a list of strings until eof is detected on stdin.   I am unable to generate an eof or enter a blank line using fread:

{ok, A} = io:fread("my kingdom for an eof or blank line: "~s")

Blank lines are echoed to the console but otherwise ignored.  Neither Ctrl-D not Ctrl-Z achieves the desired result (intercepted by the Erlang shell itself).  

I would like to match case A of eof or "~n" 
Reply all
Reply to author
Forward
0 new messages