[erlang-questions] Re: how do I get the actual list of arguments passed to an escript?

Harsh J qwertymaniac@REDACTED
Mon Apr 4 15:45:04 CEST 2011


I'm unable to reproduce your problem on R14B02. Here's my log:
http://paste.pocoo.org/show/365354/

What's your bash version? Single quotes work normally for me as well.

On Mon, Apr 4, 2011 at 7:02 PM, Matthias Lang <matthias@REDACTED> wrote:
> Hi,
>
> This escript:
>
>  #!/usr/bin/env escript
>
>  main(Args) ->
>    io:fwrite("Args=~p\n", [Args]).
>
> looks like this when it runs (from bash, on *nix, using R14B02):
>
>  ~ >./args one two "three  and four are one argument"
>  Args=["one","two","three","and","four","are","one","argument"]
>
> The escript manpage (e.g. http://www.erlang.org/doc/man/escript.html) claims
>
>  the main/1 function will be called with a list of strings
>  representing the arguments given to the script (not changed or
>  interpreted in any way).
>
> which is why I was expecting
>
>  Args=["one","two","three  and four are one argument"]
>
> How can I get the arguments without Erlang changing and interpreting them?
>
> Matt
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Harsh J
http://harshj.com



More information about the erlang-questions mailing list