The erl
program starts the Erlang runtime system.
The exact details (e.g. whether erl
is a script or a program
and which other programs it calls) are system-dependent.
Windows 95/98/2000/NT users will probably want to use the werl
program instead, which run in its own window with scrollbars and
supports command-line editing.
The erl
program on Windows provides no line editing in its
shell, and on Windows 95 there is no way to scroll back to text which
has scrolled off the screen.
The erl
program must be used, however, in pipelines or if you want
to redirect standard input or output.
erl <arguments>
Starts the Erlang system.
Any argument starting with a plus sign (+
) is always interpreted
as a system flag (described below), regardless of where it occurs
on the command line.
Arguments starting with a hyphen (-
) are the start of
a flag. A flag includes all following arguments up to the next
argument starting with a hyphen.
Example:
erl -sname arne -myflag 1 -s mod func arg
Here -sname arne
is a flag and so are -myflag 1
and -s mod func arg
. Note that these flags are treated
differently. -sname arne
is interpreted by the OTP system,
but it still included in the list of flags returned by
init:get_arguments/0
. -s mod func arg
is also
treated specially and it is not included in the return value
for init:get_arguments/0
. Finally, -myflag 1
is
not interpreted by the OTP system in any way, but it is
included in init:get_arguments/0
.
Plain arguments are not interpreted in any way. They
can be retrieved using init:get_args/0
. Plain arguments
can occur in two places: Before the first flag argument on the
command line, or after a --
argument.
The following flags are supported:
--
following will not be interpreted
in any way. They can be retrieved by init:get_args/0
.
The exception is arguments starting with a +
, which will
be interpreted as system flags (see below).
Key
configuration parameter of the
AppName
application. See application(3).
This type of flag can also be retrieved using the init
module.
File
.boot,
which is used to start the system. See init(3). Unless
File
contains an absolute path, the system searches for File
.boot in the current and <ERL_INSTALL_DIR>/bin
directories.
<ERL_INSTALL_DIR>/bin/start.boot
boot script is used.
<ERL_INSTALL_DIR>/lib
directory. $Var
is expanded
to Directory
in the boot script.
mod1.erl mod2.erl ....
and
then terminate (with non-zero exit code if the compilation of some
file didn't succeed). Implies -noinput
.
Not recommended - use erlc(1) instead.
Config
.config configuration file in order to
configure the system. See application(3).
global
will not
maintain a fully connected network of distributed erlang
nodes, and then global name registration cannot be used.
See global(3).-setcookie
.
Use -setcookie Cookie
option if want to override the default
cookie.
Variable
to the value Value
of the Erlang system. For example:
% erl -env DISPLAY gin:0In this example, an Erlang system is started with the DISPLAY environment variable set to the value
gin:0
.
-loader inet
flag is present. On each host, there must be one Erlang node running,
on which the boot_server
must be started.
Id
must be identical to the name
supplied together with the -sname
or -name
distribution
flags.
instrument
. Functionally, it behaves exactly like
an ordinary Erlang system.
Loader
can be efile
(use the
local file system), or inet
(load using the
boot_server
on another Erlang node). If Loader
is
something else, the user supplied Loader
port program is
started.
-loader
flag is omitted efile
is assumed.
make:all()
in the
current work directory and then terminate. See make(3).
Implies -noinput
.
Module
.
Only supported on Unix.
Mode
can be either
interactive
to allow automatic code loading, or
embedded
to load all code during start-up. See code(3).
Name@Host
, where
Host
is the fully qualified host name of the current host.
This flag also ensures that epmd
runs on
the current host before Erlang is started.
See epmd(1).
-noshell
.
code server
.
See code(3).
Directories
to the head of the search
path of the code server, as if code:add_pathsa/1
was
called. See code(3).
Directories
to the end of the search
path of the code server, as if code:add_pathsa/1
was
called. See code(3).
-s
flag to the init:boot()
routine.
See init(3).
Cookie
.
As erlang:set_cookie(node(),Cookie)
is used, all
other nodes will also be assumed to have their cookies
set to Cookie
. In this way, several nodes can
share one magic cookie. Erlang magic cookies are explained
in auth(3).
-name
flag, with the exception that
the host name portion of the node name will not be fully qualified.
The following command is used do start Erlang at the host with the name gin.eua.ericsson.se
% erl -sname klacke Eshell V4.7 (abort with ^G) (klacke@gin)1>Only the host name portion of the node name will be relevant. This is sometimes the only way to run distributed Erlang if the DNS (Domain Name System) is not running. There can be no communication between systems running with the
-sname
flag and those running with
the -name
flag, as node names must be unique in distributed
Erlang systems.
All these flags are processed during the start-up of the Erlang
kernel servers and before any user processes are started.
All flags are passed to init:boot(Args)
. See init(3).
All additional flags passed to the script will be passed to
init:boot/2
as well, and they can be accessed using
the init
module.
The erl
script invokes the code for the Erlang virtual
machine. This program supports the following flags:
size
.
Number
must be in the range [15,32768].
size
.
Example:
% erl -name foo +B +l
In this example, a distributed node is started with the break handler turned off and a lot of info is displayed while the code is loading.
init(3), erl_prim_loader(3), erl_boot_server(3), code(3), application(3), heart(3), net_kernel(3), auth(3), make(3), epmd(1)