This was really useful for me in scripting TextEdit to run my unit tests, as Erlide has been crashing every time I use it.

erl -run mymodule myfunc -run init stop -noshell

http://www.trapexit.org/Running_Erlang_Code_From_The_Command_Line