Problem : I am trying to run the noshell command as following and keep alive the server on port 6657, but seems that does not work.
run_server.sh
erl -make
erl -pa ebin/ -noshell -s server main 6657 -s init stop
Erlang module function
main(Port) ->
controller:start(),
FYI, on erlang prompt I can execute command - server:main(6667)
that works fine.
Can you please suggest me what I need to change in that command ?
Thanks you !
Assuming you have the module name right (you say
serverin the first snippet andchat_serverlater), the problem most likely is that-s module function arg1 [...]sends the arguments as a list of atoms, while your code requires a single integer (as you saidserver:main(6657)works). You can use-evalinstead of-s: