Turning off echo in escript

Madi, George gm4592@REDACTED
Mon Nov 16 17:29:46 CET 2009


I'm having trouble turning off echo in escript.  If I put the following
into a module:

======================
-module(testecho).
-compile(export_all).

main(_) ->
io:setopts( standard_io, [ {echo, false} ] ),
P = io:get_line( standard_io, "Enter some stuff > "),
io:format( "~nYou entered ~p~n", [ P ] ).
======================

and run it, I get the following:

======================
$ erl
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0]
[kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
1> c(testecho).
{ok,testecho}
2> testecho:main(hi).
Enter some stuff > 
You entered "Hello\n"
ok
======================

As you can see, "Hello" does not show up as I type, which is what I'm
after.  However, if I do the same in escript as follows:

======================
#!/usr/bin/env escript
%% -*- erlang -*-

main(_) ->
io:setopts( standard_io, [ {echo, false} ] ),
P = io:get_line( standard_io, "Enter some stuff > "),
io:format( "~nYou entered ~p~n", [ P ] ).
======================


I get the following:

======================
$ ./testecho.sh 
Enter some stuff > Hello

You entered "Hello\n"

$
======================


The echo does not turn off.   How do I get the echo to turn off in
escript?

Thanks,




A. G. Madi 
AT&T Chief Security Office (CSO) 




*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA623


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091116/8872669d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5201 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091116/8872669d/attachment.bin>


More information about the erlang-questions mailing list