你可能想要的是erl -s module_name function_name
原文链接:https://www.f2er.com/bash/384461.html请注意,您永远不会像在示例中那样在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).