Reputation: 109
So I straight up copy and pasted the code from the Erlang docs: https://erlang.org/doc/reference_manual/modules.html#module-syntax
Please help!
Upvotes: 2
Views: 257
Reputation: 1782
exception error: undefined shell command
almost always means that the shell environment does not have the intended function, which can also mean that the module which contains its definition has not been loaded for all the code that we write by our hand and execute. You can deliberately try to misspell some auto loaded BIF(s) for example "length1" and you will still see same message showing up.
Upvotes: 0
Reputation: 1449
The module didn't compiled. To fix it try this in the Erlang shell (eshell):
1> c(m).
ok
2> m:fact(1).
1
See documentation on how code loading works.
Upvotes: 4