Erlang makes it possible to extend the Erlang shell with your own built-in functions using the special module user_default
. We can use this to add functions to the shell, and even add custom libraries to the code path for all Erlang shells.
- Start by creating a file called
.erlang
in your home directory. Any Erlang expression ending with a dot in this file will be executed when the Erlang shell starts - Create the directory
~/.erlang.d
:$ mkdir ~/.erlang.d