[erlang]erlang程序运行的几种方式
2011-12-15 17:38
323 查看
1.在erlang shell中编译运行
2 在命令行提示符下编译运行
快速脚本
3 当做escript脚本运行
-module(hello). -export([start/0]). start() -> io:format("Hello world~n").
erl Erlang R14B03 (erts-5.8.4) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.8.4 (abort with ^G) 1> c(hello). {ok,hello} 2> hello: module_info/0 module_info/1 start/0 2> hello:start(). Hello world ok 3>
2 在命令行提示符下编译运行
erlc hello.erl erl -noshell -s hello start -s init stop
快速脚本
erl -eval 'io:format("Memory:~p~n",[erlang:memory(total)]).' -noshell -s init stop
3 当做escript脚本运行
#!/usr/bin/escript main(_) -> io:format("Hello World~n").
chmod +x hello ./hello
相关文章推荐
- erlang程序运行的几种方式
- erlang程序运行的几种方式
- Spark on yarn--几种提交集群运行spark程序的方式
- scala程序运行的几种方式
- Unix/Linux中后台运行程序(断开shell连接后继续执行)的几种方式
- 运行Python程序的几种方式
- 运行Python程序的2种方式
- 程序自启动及后台持续运行的研究(voip和GPS方式)
- 判断 php 程序是通过什么方式运行的 (浏览器,还是命令行)
- 使C#程序脱离.net框架运行(非飞信方式)
- android完全退出程序的几种方式
- 说说 Windows 脚本宿主运行的几种方式
- 获取程序运行路径的几种方法
- 让程序后台运行的几种方法
- Android AnimationDrawable运行的几种方式
- linux 使用非当前登录运行程序方式,如root登录用test运行一个test.sh
- Wince下面添加应用程序,并且自动运行----几种方式介绍
- 总结运行SSIS包的几种方式
- 对象事件与处理程序代码进行关联的几种方式
- C++以阻塞的方式调用外部exe程序,等待其运行结束