This module is preloaded and contains the code for
the
Starts the Erlang runtime system. This function is called when the emulator is started and coordinates system startup.
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"]]}
The following flags 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 and 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 command-line flag
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
Gets the identity of the boot script used to boot the system.
The same as
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 only purpose of releasing it before it is ready
is to obtain early feedback. The file format, semantics,
interfaces, and so on, can be changed in a future release. The
The
Everything following
Can be set to
Strictly as it appears in the
This flag is particular
useful when you want to elaborate with code loading from
archives without editing the
Specifies the module to use for registration and lookup of
node names. Defaults to
Scans, parses, and evaluates an arbitrary expression
% 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
Because of the limited length of atoms, it is recommended to
use
% 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