I have an erlang application, compiled with rebar.
Normally I start it with like this:
application:start(myapp).
from inside the erl shell.
Could anyone tell me how to start it like a normal command line program?
On a Unix system you enter the command erl at the operating system prompt. This command starts the Erlang runtime system and the Erlang shell. On the Windows platform you normally start Erlang/OTP from the start menu. You can also enter the command erl or werl from a DOS box or Command box.
If you then press a (for abort) you will exit the shell directly. Other ways of exiting the erlang shell are: init:stop() which does the same thing as q() or erlang:halt() .
Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging.
A process can terminate itself by calling one of the BIFs exit(Reason), erlang:error(Reason), erlang:error(Reason, Args), erlang:fault(Reason) or erlang:fault(Reason, Args). The process then terminates with reason Reason for exit/1 or {Reason,Stack} for the others.
You can do:
erl -pa ebin -eval "application:start(myapp)"
If you want it to run in the background, add -noshell -detached
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With