I have a function start with two parameters in module mymodule. How can I run this function from command line.
I try this:
erl -name myname@myserver.com -s mymodule start 5 10
But It raises error:
{“init terminating in do_boot”,{undef,[{mymodule,start,[[‘5′,’10’]]},{init,start_it,1},{init,start_em,1}]}}
I want to be able to run this function from a bash file
I think it expects the start function to have arity of one, so in this case it is attempting to call module:start([‘5′,’10’]). So change your start function to accept a list of 2 parameters as in [arg1,arg2]. Also, check out the documentation on the -run and -s flags. -s passes arguments as atoms while -run passes them as strings