init:stop/1 in escript
Bengt Kleberg <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Organization | Ericsson AB |
| Message-ID | <[email protected]> |
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 ).
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs