简体   繁体   English

从命令行启动erlang应用程序

[英]start erlang application from command line

I have an erlang application, compiled with rebar. 我有一个用rebar编译的erlang应用程序。

Normally I start it with like this: 通常我会这样开始:

application:start(myapp).

from inside the erl shell. 从erl shell里面。

Could anyone tell me how to start it like a normal command line program? 谁能告诉我如何像正常的命令行程序一样启动它?

You can do: 你可以做:

erl -pa ebin -eval "application:start(myapp)"

If you want it to run in the background, add -noshell -detached 如果您希望它在后台运行,请添加-noshell -detached

Create shell script, something like that: 创建shell脚本,类似于:

exec erl -pa ebin/ deps/*/ebin -s myapp

Other options which you need see http://www.erlang.org/doc/man/erl.html . 您需要的其他选项见http://www.erlang.org/doc/man/erl.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM