Running an application from the (unix) command line

Gunilla Arendt gunilla@REDACTED
Mon Jan 23 09:36:10 CET 2006


Snip from erl(1):

"-s Mod [Func [Arg1, Arg2, ...]]
  Makes 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."

Thus "erl -s application start myapp" will result in a call to
"application:start([myapp])" instead of the desired
"application:start(myapp)".

I recommend you create a boot script which starts your application
instead. You can either write a .rel file and use it to generate
a boot script, or edit an existing .script file and use
systools:script2boot/1 to transform it into a .boot file. See
OTP Design Principles and systools(3) for details.

/ Gunilla

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




More information about the erlang-questions mailing list