run an Erlang program directly from the unix shell?
As of Erlang/OTP R11B-4, you can run Erlang code without compiling by using Escript. The manual page has a complete example showing how to do it. Escript is intended for short, “script-like” programs. A more general way to do it, which also works for older Erlang releases, is to start the Erlang VM without a shell and pass more switches to the Erlang virtual machine.