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.
Starts an Erlang runtime system.
The arguments can be divided into emulator flags, flags and plain arguments:
+
is
interpreted as an emulator
flag.-
(hyphen) is interpreted as a
flag which should
be passed to the Erlang part of the runtime system, more
specifically to the init
system process, see
init(3).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
.init
process and can be
retrieved by calling init:get_plain_arguments/0
.
Plain arguments can occur before the first flag, or after
a --
flag. Additionally, the flag -extra
causes everything that follows to become plain arguments.
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.
--
(init flag)
--
up to the next flag
(-flag
or +flag
) is considered plain arguments
and can be retrieved using init:get_plain_arguments/0
.
-Application Par Val
Par
to
the value Val
for the application Application
,
see app(4) and
application(3).
-args_file FileName
FileName
.
The arguments read from the file replace the
'-args_file FileName
' flag on the resulting command line.
FileName
should be a plain text file and may
contain comments and command line arguments. A comment begins
with a # character and continues until next end of line character.
Backslash (\) is used as quoting character. All command line
arguments accepted by erl
are allowed, also the
-args_file FileName
flag. Be careful not to cause circular
dependencies between files containing the -args_file
flag,
though.
-extra
flag is treated specially. Its scope ends
at the end of the file. Arguments following an -extra
flag are moved on the command line into the -extra
section,
i.e. the end of the command line following after an -extra
flag.
-async_shell_start
-boot File
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 $ROOT/bin
directories.$ROOT/bin/start.boot
.-boot_var Var Dir
Var
other
than $ROOT
, this variable is expanded to Dir
.
Used when applications are installed in another directory
than $ROOT/lib
, see
systools:make_script/1,2.-code_path_cache
-compile Mod1 Mod2 ...
-noinput
. Not recommended - use
erlc instead.-config Config
Config.config
, which is used to configure
applications. See
app(4) and
application(3).
-connect_all false
global
will not maintain a
fully connected network of distributed Erlang nodes, and then
global name registration cannot be used. See
global(3).-cookie Cookie
-setcookie
. Use -setcookie
instead.-detached
-emu_args
-env Variable Value
Variable
to
the value Value
for the Erlang runtime system.
Example:% erl -env DISPLAY gin:0In this example, an Erlang runtime system is started with the
DISPLAY
environment variable set to gin:0
.
-eval Expr
(init flag)
init
evaluate the expression Expr
, see
init(3).-extra
(init flag)
-extra
is considered plain
arguments and can be retrieved using
init:get_plain_arguments/0
.-heart
-hidden
nodes/0
on the other
node. See also hidden global groups,
global_group(3).
-hosts Hosts
-loader inet
flag is
present."150.236.20.74"
. Hosts names are not acceptable, but
a broadcast address (preferably limited to the local network)
is.-id Id
Id
must be identical to
the name supplied together with the -sname
or
-name
flag.-init_debug
init
write some debug information while
interpreting the boot script.-instr
(emulator flag)
instrument
.
Functionally, it behaves exactly like an ordinary Erlang
runtime system.-loader Loader
erl_prim_loader
to load
Erlang modules into the system. See
erl_prim_loader(3).
Two Loader
methods are supported, efile
and
inet
. efile
means use the local file system,
this is the default. inet
means use a boot server on
another machine, and the -id
, -hosts
and
-setcookie
flags must be specified as well. If
Loader
is something else, the user supplied
Loader
port program is started.-make
make:all()
in
the current working directory and then terminate. See
make(3). Implies
-noinput
.-man Module
Module
.
Only supported on Unix.-mode interactive | embedded
interactive
), or if all code should be loaded
during system initialization (embedded
), see
code(3). Defaults to
interactive
.-name Name
epmd
runs on the current host
before Erlang is started. See
epmd(1).Name@Host
, where
Host
is the fully qualified host name of the current
host. For short names, use the -sname
flag instead.-noinput
-noshell
.-noshell
-nostick
-oldshell
-pa Dir1 Dir2 ...
code:add_pathsa/1
. See
code(3).-pz Dir1 Dir2 ...
code:add_pathsz/1
. See
code(3).-remsh Node
Node
.
-rsh Program
rsh
for starting a slave
node on a remote host. See
slave(3).-run Mod [Func [Arg1, Arg2, ...]]
(init flag)
init
call the specified function. Func
defaults to start
. If no arguments are provided,
the function is assumed to be of arity 0. Otherwise it is
assumed to be of arity 1, taking the list
[Arg1,Arg2,...]
as argument. All arguments are passed
as strings. See
init(3).-s Mod [Func [Arg1, Arg2, ...]]
(init flag)
init
call the specified function. Func
defaults to start
. If no arguments are provided,
the function is assumed to be of arity 0. Otherwise it is
assumed to be of arity 1, taking the list
[Arg1,Arg2,...]
as argument. All arguments are passed
as atoms. See
init(3).-setcookie Cookie
Cookie
, see
erlang:set_cookie/2.-shutdown_time Time
init
process is allowed to spend shutting down the system. If
Time
ms have elapsed, all processes still existing are
killed. Defaults to infinity
.-sname Name
-name
, but the host name portion of the node
name Name@Host
will be the short name, not fully
qualified.-sname
flag and those running with the -name
flag, as node
names must be unique in distributed Erlang systems.-smp [enable|auto|disable]
-smp enable
and -smp
starts the Erlang runtime
system with SMP support enabled. This may fail if no runtime
system with SMP support is available. -smp auto
starts
the Erlang runtime system with SMP support enabled if it is
available and more than one logical processor are detected.
-smp disable
starts a runtime system without SMP
support. This is currently the default behavior. -smp auto
will probably be the default behavior some time in the future.-version
(emulator flag)
erl +V
.erl
invokes the code for the Erlang emulator (virtual
machine), which supports the following flags:
+a size
+A size
+B [c | d | i]
c
option makes Ctrl-C
interrupt the current
shell instead of invoking the emulator break handler.
The d
option (same as specifying +B
without an
extra option) disables the break handler. The i
option
makes the emulator ignore any break signal.c
option is used with oldshell
on Unix,
Ctrl-C
will restart the shell process rather than
interrupt it.werl
, not erl
(oldshell
). Note also that
Ctrl-Break
is used instead of Ctrl-C
on Windows.
+c
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.)+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.+h Size
Size
.+K true | false
false
(disabled).
If the emulator does not support kernel poll, and
the +K
flag is passed to the emulator, a warning is
issued at startup.+l
+MFlag Value
+P Number
Number
must be in the range 16..134217727.
Default is 32768.+R ReleaseNumber
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.
+R 9
flag can co-exist with R9 nodes in the same distributed
Erlang system, they are R9-compatible.+r
+S Number
+T Level
spawn
, spawn_link
,
spawn_monitor
, or spawn_opt
will be scheduled
out immediately after completing the call. When higher modified
timing levels are used, the caller will also sleep for a while
after being scheduled out.
return_to
and return_from
trace messages will be lost when tracing on the spawn BIFs. This
flag may be removed or changed at any time without prior notice.
+V
+v
+W w | i
error_logger
.
Messages sent to the error logger using one of the warning
routines can be mapped either to errors (default), warnings
(+W w
), or info reports (+W i
). The current
mapping can be retrieved using
error_logger:warning_map/0
. See
error_logger(3)
for further information.
ERL_CRASH_DUMP
erl_crash.dump
in the current directory.ERL_CRASH_DUMP_NICE
ERL_CRASH_DUMP_SECONDS
ERL_AFLAGS
erl
.
-extra
flag is treated specially. Its scope ends
at the end of the environment variable content. Arguments
following an -extra
flag are moved on the command line into
the -extra
section, i.e. the end of the command line
following after an -extra
flag.
ERL_ZFLAGS
and ERL_FLAGS
erl
.
-extra
flag is treated specially. Its scope ends
at the end of the environment variable content. Arguments
following an -extra
flag are moved on the command line into
the -extra
section, i.e. the end of the command line
following after an -extra
flag.
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)