Running an application from the (unix) command line

Matthias Lang <>
Sat Jan 21 08:53:02 CET 2006

Pupeno writes:
 > Hello,
 > how do you run an application from the command line ?
 > erl -s application start myapp
 > doesn't seem to work.

Try following the instructions in the FAQ exactly:

  | 5.7. an Erlang program directly from the unix shell?
  | To run Erlang programs without running the Erlang shell, we just pass
  | some more switches to the Erlang virtual machine. Here's hello world
  | again:
  | 	-module(hello).
  | 	-export([hello_world/0]).
  | 	hello_world() -> 
  | 		io:fwrite("hello, world\n").
  | Save this as hello.erl, compile it and run it directly from the unix
  | (or msdos) command line:
  | 	matthias >erl -compile hello
  | 	matthias >erl -noshell -s hello hello_world -s init stop
  | 	hello, world
You find the rest of the FAQ at

and if you want to know the full details of command line passing, this
part of the manual explains it:


More information about the erlang-questions mailing list