加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – Erlang:在Erl文件中启动函数的命令行

发布时间:2020-12-16 01:21:50 所属栏目:安全 来源:网络整理
导读:我可以通过命令行或bash脚本启动Erlang文件: exec erl file.erl 但是,我似乎无法找到如何直接启动此文件中的函数. 例如 exec erl file.erl -f function() 任何建议赞赏…… 你可能想要的是erl -s module_name function_name 请注意,您永远不会像在示例中那
我可以通过命令行或bash脚本启动Erlang文件:
exec erl file.erl

但是,我似乎无法找到如何直接启动此文件中的函数.

例如

exec erl file.erl -f function()

任何建议赞赏……

你可能想要的是erl -s module_name function_name

请注意,您永远不会像在示例中那样在erl命令中指定erlang文件. Erlang VM加载代码路径中的所有模块.这包括本地目录.

从http://www.erlang.org/doc/man/erl.html开始:

-run Mod [Func [Arg1,Arg2,…]]
(init flag) Makes init call the specified
function. Func defaults to start. If
no arguments are provided,the
function is assumed to be of arity 0.
Otherwise it is assumed to be of arity
1,taking the list [Arg1,…] as
argument. All arguments are passed as
strings. See init(3).

-s Mod [Func [Arg1,…]] (init flag) Makes init call the specified function. Func defaults to start. If no arguments are provided,the function is assumed to be of arity 0. Otherwise it is assumed to be of arity 1,…] as argument. All arguments are passed as atoms. See init(3).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读