Erlang basics · Lesson 25 (open contents)
Shape builds and make a command
With no path argument, will the entry point treat the empty list as a filename?
Before running: In erl run {ok, nb_entry} = c(nb_entry), nb_entry:main([]). To package, run {ok, nb_entry} = c(nb_entry), ok = escript:create("nb_entry.escript", [shebang, {beam, "nb_entry.beam"}]). After both succeed, open another system terminal in the same directory and run escript nb_entry.escript report.txt. Recompile and repackage after edits.
PredictWill main([]) print a path or usage? What does it return?
These are fixed example results. This page does not execute code on your computer. Full project examples and reference material are on the deeper page.
Used here: Lesson 04 · Bind a variable onceLesson 09 · Put code in a moduleLesson 17 · Put one tested module in Rebar3
Go deeper: full examples, original exercises and further reading →