[erlang-questions] Getting a password from escript / I/O server introduction
Raimo Niskanen
raimo+erlang-questions@REDACTED
Thu Nov 24 09:41:40 CET 2011
On Thu, Nov 24, 2011 at 10:34:39AM +0200, Mikhail Sobolev wrote:
> Hi Alex,
>
> On 24 November 2011 10:18, Alex Shneyderman <a.shneyderman@REDACTED> wrote:
>
> > You expect the get_line not to print anything?
Have you tried the simple solution man io suggests; here tried in the
shell not tried in an escript:
Eshell V5.8.4 (abort with ^G)
1> f(V), io:setopts([{echo,false}]), V = io:get_line("Prompt> "), io:setopts([{echo,true}]), {got,V}.
Prompt> {got,"hello\n"}
Nothing is echoed when I type "hello" but the result {got,V}
is printed by the shell.
> >
> > You have two formats in the script. One os for prompting and another
> > one is for output. The get_line is only waiting for the user to enter
> > text then saves it into R and then you do a format again. Are you
> > saying that you do not want the text on line that says "Input > yes"
> > to not say yes ?
> >
> > I actually would not know the answer to that, but I guess it is worth
> > clarifying :-) since it is not at all obvious. The standard behavior
> > on the user input is to output to the screen what she is typing.
> >
> > Yes, what I expect is:
>
> tmp $ ./q
> > Input >
> > -> "yes\n"
> >
>
> --
> Misha
>
> PS Please keep erlang-questions in the loop...
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
More information about the erlang-questions
mailing list