The
Starts the Erlang runtime system. This function is called when the emulator is started and coordinates system start-up.
Returns all values associated with the command line user flag
% erl -a b c -a d ... 1> init:get_argument(a). {ok,[["b","c"],["d"]]}
There are also a number of flags, which are defined automatically and can be retrieved using this function:
The installation directory of Erlang/OTP,
2> init:get_argument(root). {ok,[["/usr/local/otp/releases/otp_beam_solaris8_r10b_patched"]]}
The name of the program which started Erlang.
3> init:get_argument(progname). {ok,[["erl"]]}
The home directory.
4> init:get_argument(home). {ok,[["/home/harry"]]}
Returns
Returns all command line flags, as well as the system
defined flags, see
Returns any plain command line arguments as a list of strings (possibly empty).
The current status of the
All applications are taken down smoothly, all code is
unloaded, and all ports are closed before the system
terminates. If the
To limit the shutdown time, the time
The system is restarted inside the running Erlang
node, which means that the emulator is not restarted. All
applications are taken down smoothly, all code is unloaded,
and all ports are closed before the system is booted again in
the same way as initially started. The same
To limit the shutdown time, the time
Get the identity of the boot script used to boot the system.
All applications are taken down smoothly, all code is
unloaded, and all ports are closed before the system
terminates. If the
To limit the shutdown time, the time
All applications are taken down smoothly, all code is
unloaded, and all ports are closed before the system
terminates by calling
To limit the shutdown time, the time
The support for loading of code from archive files is
experimental. The sole purpose of releasing it before it is ready
is to obtain early feedback. The file format, semantics,
interfaces etc. may be changed in a future release. The
The
Everything following
This flag can be set to
Scans, parses and evaluates an arbitrary expression
% erl -eval '{X,Y,Z}' = now(), random:seed(X,Y,Z).'
This example uses Erlang as a hexadecimal calculator:
% erl -noshell -eval 'R = 16#1F+16#A0, io:format("~.16B~n", [R])' \\ -s erlang halt BF
If multiple
Everything following
Evaluates the specified function call during system
initialization.
Example:
% erl -run foo -run foo bar -run foo bar baz 1 2
This starts the Erlang runtime system and evaluates the following functions:
foo:start()
foo:bar()
foo:bar(["baz", "1", "2"]).
The functions are executed sequentially in an initialization
process, which then terminates normally and passes control to
the user. This means that a
Evaluates the specified function call during system
initialization.
Example:
% erl -s foo -s foo bar -s foo bar baz 1 2
This starts the Erlang runtime system and evaluates the following functions:
foo:start()
foo:bar()
foo:bar([baz, '1', '2']).
The functions are executed sequentially in an initialization
process, which then terminates normally and passes control to
the user. This means that a
Due to the limited length of atoms, it is recommended that
% erl -- a b -children thomas claire -ages 7 3 -- x y ... 1> init:get_plain_arguments(). ["a","b","x","y"] 2> init:get_argument(children). {ok,[["thomas","claire"]]} 3> init:get_argument(ages). {ok, [["7","3"]]} 4> init:get_argument(silly). error