[erlang-questions] erl, escript, shebangs and syntax errors

Maxim Treskin zerthurd@REDACTED
Fri Sep 30 03:33:02 CEST 2011


You should not compile this script, just run. Remove first line If you want
compile it as regular erlang module.

On 30 September 2011 01:25, Andrew Pennebaker
<andrew.pennebaker@REDACTED>wrote:

> Please instruct erl to ignore shebangs.
>
> $ cat hello.erl
> #!/usr/bin/env escript
>
> -module(hello).
> -export([main/1]).
>
> main(_) -> io:format("Hello World!~n", []).wonko:Desktop andrew$
> ./hello.erl
> Hello World!
> wonko:Desktop andrew$ erl
> Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:2:2] [rq:2]
> [async-threads:0] [hipe] [kernel-poll:false]
>
> Eshell V5.8.4  (abort with ^G)
> 1> c(hello).
> ./hello.erl:1: syntax error before: '#'
> ./hello.erl:4: no module definition
> error
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Maxim Treskin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110930/372fc94b/attachment.htm>


More information about the erlang-questions mailing list