shell_default(3)
π shell_default β it's giving Erlang Module Definition π¦
ok so this is the shell_default page from the Erlang docs, manual section 3, and it's literally all about making your Erlang shell feel like your shell. bestie, let's get into it β¨
πΈ NAME πΈ
shell_default β customizing the Erlang environment, no cap π
β¨ DESCRIPTION β¨
okay so here's the tea π: the functions in this module get called when you don't specify a module name in a shell command. that's it, that's the whole vibe.
lowkey the clearest way to get it is with an example, so picture this shell dialog:
1> lists:reverse("abc").
"cba"
2> c(foo).
{ok, foo}
so in command one, module lists is called β you named it, everyone knows who's on aux π. in command two, no module name is specified at all. and here's the part that matters: the shell searches module user_default first, and then module shell_default, looking for function c/1 π
and like, why do both exist?? bc they serve two totally different purposes, iykyk:
- shell_default is for "system wide" customizations to the shell π
- user_default is for "local" or individual user customizations π«Ά
π§ Hint π§
want your own commands in the shell?? obsessed, do it bestie π here's the recipe:
- create a module called user_default
- add the commands you want to it
- then add the following line as the first line in your
.erlangfile in your home directory:
code:load_abs("$PATH/user_default").
and $PATH (yes, in the code, exactly like that) is the directory where your user_default module can be found π
β FUNCTIONS β
help() -> true.β prints the help for all the shell commands. every single one. main character behavior fr fr π
ok that's the whole page, short and sweet, we love a compact manpage β¨
sign-off time ππ¦: this gorgeous little page comes to you from Ericsson AB, rocking version stdlib 8.0.4 β and it's filed under shell_default(3), so you can always find your way back, bestie π
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms