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

Andrew Pennebaker <>
Thu Sep 29 20:25:36 CEST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110929/049a792c/attachment.html>


More information about the erlang-questions mailing list