The erl program starts an Erlang runtime system. The exact details (for example, whether erl is a script or a program and which other programs it calls) are system-dependent.
Windows users probably wants to use the werl program instead, which runs 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 an Erlang runtime system.
The arguments can be divided into emulator flags, flags and plain arguments:
As indicated by the name, emulator flags controls the behavior of the emulator.
The init process itself interprets some of these flags, the init flags. It also stores any remaining flags, the user flags. The latter can be retrieved by calling init:get_argument/1.
It can be noted that there are a small number of "-" flags which now actually are emulator flags, see the description below.
Example:
%erl +W w -sname arnie +R 9 -s my_init -extra +bertie
(arnie@host)1>init:get_argument(sname).
{ok,[["arnie"]]}
(arnie@host)2>init:get_plain_arguments().
["+bertie"]
Here +W w and +R 9 are emulator flags. -s my_init is an init flag, interpreted by init. -sname arnie is a user flag, stored by init. It is read by Kernel and will cause the Erlang runtime system to become distributed. Finally, everything after -extra (that is, +bertie) is considered as plain arguments.
%erl -myflag 1
1>init:get_argument(myflag).
{ok,[["1"]]}
2>init:get_plain_arguments().
[]
Here the user flag -myflag 1 is passed to and stored by the init process. It is a user defined flag, presumably used by some user defined application.
In the following list, init flags are marked (init flag). Unless otherwise specified, all other flags are user flags, for which the values can be retrieved by calling init:get_argument/1. Note that the list of user flags is not exhaustive, there may be additional, application specific flags which instead are documented in the corresponding application documentation.
Defaults to $ROOT/bin/start.boot.
If this flag is present, global will not maintain a fully connected network of distributed Erlang nodes, and then global name registration cannot be used. See
%erl -env DISPLAY gin:0
In this example, an Erlang runtime system is started with the DISPLAY environment variable set to gin:0.
The IP addresses must be given in the standard form (four decimal numbers separated by periods, for example "150.236.20.74". Hosts names are not acceptable, but a broadcast address (preferably limited to the local network) is.
Selects an instrumented Erlang runtime system (virtual machine) to run, instead of the ordinary one. When running an instrumented runtime system, some resource usage data can be obtained and analysed using the module instrument. Functionally, it behaves exactly like an ordinary Erlang runtime system.
The name of the node will be Name@Host, where Host is the fully qualified host name of the current host. For short names, use the -sname flag instead.
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 nodes running with the -sname flag and those running with the -name flag, as node names must be unique in distributed Erlang systems.
Start the Erlang runtime system with smp support enabled.
NOTE: It will not be available on all supported platforms. See also the +S flag.
erl invokes the code for the Erlang emulator (virtual machine), which supports the following flags:
If the c option is used with oldshell on Unix, Ctrl-C will restart the shell process rather than interrupt it.
Note that on Windows, this flag is only applicable for werl, not erl (oldshell). Note also that Ctrl-Break is used instead of Ctrl-C on Windows.
Normally, erlang:now/0 will not immediately reflect sudden changes in the system time, in order to keep timers (including receive-after) working. Instead, the time maintained by erlang:now/0 is slowly adjusted towards the new system time. (Slowly means in one percent adjustments; if the time is off by one minute, the time will be adjusted in 100 minutes.)
When the +c option is given, this slow adjustment will not take place. Instead erlang:now/0 will always reflect the current system time. Note that timers are based on erlang:now/0. If the system time jumps, timers then time out at the wrong time.
Memory allocator specific flags, see erts_alloc(3) for further information.
Sets the maximum number of concurrent processes for this system. Number must be in the range 16..134217727. Default is 32768.
Sets the compatibility mode.
The distribution mechanism is not backwards compatible by default. This flags sets the emulator in compatibility mode with an earlier Erlang/OTP release ReleaseNumber. The release number must be in the range 7..<current release>. This limits the emulator, making it possible for it to communicate with Erlang nodes (as well as C- and Java nodes) running that earlier release.
For example, an R10 node is not automatically compatible with an R9 node, but R10 nodes started with the +R 9 flag can co-exist with R9 nodes in the same distributed Erlang system, they are R9-compatible.
Note: Make sure all nodes (Erlang-, C-, and Java nodes) of a distributed Erlang system is of the same Erlang/OTP release, or from two different Erlang/OTP releases X and Y, where all Y nodes have compatibility mode X.
For example: A distributed Erlang system can consist of R10 nodes, or of R9 nodes and R9-compatible R10 nodes, but not of R9 nodes, R9-compatible R10 nodes and "regular" R10 nodes, as R9 and "regular" R10 nodes are not compatible.
Sets the number of scheduler threads to use when smp support has been enabled. Valid range is 1-1024. If the Erlang runtime system is able to determine the number of processor cores available, the default value will equal the this value; otherwise, the default value will be one.
This flag will be ignored if the emulator doesn't have smp support enabled (see the -smp flag).
The +m, +t, and +T flags have changed to, respectively, +MYm, +MYtt, and +MYtp. The +d, and +S* flags have been removed. See erts_alloc(3) for further information.
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), erts_alloc(3)
Joe Armstrong - support@erlang.ericsson.se Magnus Fröberg - support@erlang.ericsson.se Per Hedeland - support@erlang.ericsson.se Sebastian Strollo - support@erlang.ericsson.se Claes Wikström - support@erlang.ericsson.se Mike Williams - support@erlang.ericsson.se Robert Virding - support@erlang.ericsson.se Rickard Green -