[erlang-questions] Hiding user input in escript

Michal Ptaszek <>
Fri Apr 24 12:40:06 CEST 2009


----- "Bjorn Gustavsson" <> wrote:

> On Fri, Apr 24, 2009 at 9:19 AM, Michal Ptaszek
> <> 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



More information about the erlang-questions mailing list