Is it possible to disable echo while reading the data
from the stdin in escript?
What I would like to achieve is something similar to
`stty -echo`
in Unix shells.
Best regards,
--
Michal Ptaszek
www.erlang-consulting.com
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions
io:get_password/0
/Bjorn
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
> On Fri, Apr 24, 2009 at 9:19 AM, Michal Ptaszek
> <michal....@erlang-consulting.com> wrote:
> > Hello All,
> >
> > Is it possible to disable echo while reading the data
> > from the stdin in escript?
> >
>
> io:get_password/0
>
It seems it does not like me:
cat pass.erl
#!/usr/bin/env escript
main(_) ->
io:format("Password: "),
A = io:get_password(),
io:format("A = ~p~n", [A]).
./pass.erl:
Password: A = {error,{request,get_password}}
When it is running inside the Erlang shell, works perfectly.
What am I doing wrong?
BR
--
Michal Ptaszek
www.erlang-consulting.com
Sorry, I only tested it inside an Erlang shell, not in escript.
The problem seems to be that escript uses the old shell, which
does not support any way to control the terminal.
We'll have a look at escript for the next release and see whether
it would be possible to have it run with the standard shell.
/Bjorn
>
> BR
> --
> Michal Ptaszek
> www.erlang-consulting.com
>
--
Björn Gustavsson, Erlang/OTP, Ericsson AB