如何指定调用 "erl" 命令时要使用的“.erlang”?
How to specify the ".erlang" to use when "erl" command is called?
原文.erlang
包含code:add_pathz("/Users/xxxxx/Documents/Project/CY2/keyboard/ebin").
它位于 ~/.erlang
.
另一个erlang启动文件包含
code:add_pathz("/Users/xxxxx/Documents/Project/CY2/keyboard/_build/default/rel/lib/keybord/ebin").
我想指定使用哪个.erlang
,可以吗?
根据 the docs,它不是。
When Erlang/OTP is started, the system searches for a file named .erlang
in the user's home directory.
实际上……我检查了一下,虽然你不能选择不同的 .erlang
,但你可以通过设置不同的来完全禁用它的执行]你的节点的主路径,像这样…
/tmp$ cat ~/.erlang
io:format("This is ~~/.erlang~n").
/tmp$ erl
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
This is ~/.erlang
Eshell V12.0.2 (abort with ^G)
1>
User switch command
--> q
/tmp$ cat /tmp/.erlang
io:format("This is NOT ~~/.erlang~n").
/tmp$ erl -home /tmp
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Eshell V12.0.2 (abort with ^G)
1>
User switch command
--> q
/tmp$
原文.erlang
包含code:add_pathz("/Users/xxxxx/Documents/Project/CY2/keyboard/ebin").
它位于 ~/.erlang
.
另一个erlang启动文件包含
code:add_pathz("/Users/xxxxx/Documents/Project/CY2/keyboard/_build/default/rel/lib/keybord/ebin").
我想指定使用哪个.erlang
,可以吗?
根据 the docs,它不是。
When Erlang/OTP is started, the system searches for a file named
.erlang
in the user's home directory.
实际上……我检查了一下,虽然你不能选择不同的 .erlang
,但你可以通过设置不同的来完全禁用它的执行]你的节点的主路径,像这样…
/tmp$ cat ~/.erlang
io:format("This is ~~/.erlang~n").
/tmp$ erl
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
This is ~/.erlang
Eshell V12.0.2 (abort with ^G)
1>
User switch command
--> q
/tmp$ cat /tmp/.erlang
io:format("This is NOT ~~/.erlang~n").
/tmp$ erl -home /tmp
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Eshell V12.0.2 (abort with ^G)
1>
User switch command
--> q
/tmp$