[erlang-questions] help me to read proper input from commandline erl

Matthew Evans mattevans123@REDACTED
Fri Feb 21 15:41:50 CET 2014


Not sure if there's another way...
List = "[1,2,3,4]".                                    
{ok,T,_} = erl_scan:string(String++".").
{ok,A} = erl_parse:parse_exprs(T).      
{value,Value,_} = erl_eval:exprs(A, erl_eval:new_bindings()).
Value.[1,2,3,4]

> Date: Fri, 21 Feb 2014 03:05:53 -0800
> From: ponmuthu.m@REDACTED
> To: erlang-questions@REDACTED
> Subject: [erlang-questions] help me to read proper input from commandline erl
> 
> hi all,
> 
>       while get runtime command prompt variable via init:get_argument(name).
> 
> 
>     i want to get a list . but in that " " are added while getting & assign
> to a varaible
> 
> 
> % erl -mylist [1,2,3,4]
> 
> > {ok,[[List|_]|_]} = init:get_argument(mylist).
> {ok,[["[1,2,3,4]"]]}
> >List.
> "[1,2,3,4]"
> 
> 
> 
> but expecting O/p as
> 
> >List.
> [1,2,3,4]
> 
> 
> please help , because of this double qutoes am not able to do Head & Tail .
> 
> 
> 
> 
> --
> View this message in context: http://erlang.2086793.n4.nabble.com/help-me-to-read-proper-input-from-commandline-erl-tp4655367.html
> Sent from the Erlang Questions mailing list archive at Nabble.com.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140221/73dbf2c6/attachment.htm>


More information about the erlang-questions mailing list