1

所以这就是我想要的 - 从 bash shell 执行以下迷你脚本:

mnesia:change_table_copy_type(schema, node(), disc_copies).

我试图找出可能性,但找不到明确的答案。有一个“-noshell”选项,或者,“-oldshell”选项,但它们都没有说明如何执行上述任何命令。

我怎么做?

4

1 回答 1

2

您可以为此使用-noshellwith 。-eval "mnesia:change_table_copy_type(schema, node(), disc_copies)"您还必须-run init stop在此之后通过以确保 Erlang VM 在运行命令后停止,否则即使在评估-eval代码后 VM 仍将继续运行。

erl -noshell -eval "mnesia:change_table_copy_type(schema, node(), disc_copies)" -run init stop
于 2016-05-18T09:21:51.030 回答