[erlang-questions] "-noshell" on R9C

Peter Lund <>
Tue Apr 3 17:11:58 CEST 2007

Trying to use io:print_chars/1 on R9C in combination with unix pipes and 
the "-noshell" option on a new MacOS X machine.

Does anyone perhaps know why I get "[]" before each character below?

$ erlc myprint.erl

$ cat test.txt
My example text.

$ cat test.txt | erl -noshell -run myprint print     
[]M[]y[] []e[]x[]a[]m[]p[]l[]e[] []t[]e[]x[]t[].[]
[]Num chars 17

$ cat myprint.erl


print() -> print(get_char(),0).

print(eof,N) ->
    io:format("Num chars ~p\n",[N]),
print(C,N) when is_integer(C) ->

get_char() ->
    case io:get_chars("",1) of
        eof -> eof;
        [C] -> C

More information about the erlang-questions mailing list