[erlang-bugs] init:stop/1 in escript
Bengt Kleberg
bengt.kleberg@REDACTED
Tue Jun 17 15:07:33 CEST 2014
Greetings,
Should init:stop/1 behave the same way in an escript as in a normal
module?
I have this escript(*). When I run it from Unix shell:
sekic1152 [3:01pm] [/home/eleberg] -> ./t.erl
sekic1152 [3:02pm] [/home/eleberg] -> echo $?
0
The same (comment out line 1) program when run from Erlang shell:
2> c(t).
{ok,t}
3> t:main(asd).
ok
4> sekic1152 [3:01pm] [/home/eleberg] -> echo $?
1
I think it is a bug that the status is different from 1 in the escript.
My work around is to use erlang:halt/1
bengt
(*)
#! /usr/bin/env escript
-module( t ).
-export( [main/1] ).
main( _ ) -> init:stop( 1 ).
More information about the erlang-bugs
mailing list