#!/home/ml/313/bin/escript %%% %%% all command line arguments are passed to "main" in one list %%% here I only accept one argument: the file name. %%% %%% erlang:halt stops all processes and quits. %%% %%% make sure to make your script "executable": chmod +x echo.erl %%% %%% this is a simple echo command like the Unix builtin, but prints each arg on a separate line %%% main( Args ) -> lists:foreach( fun(A) -> io:format("~p~n", [A]) end, Args), erlang:halt().