shell_default(3erl)
β¨ shell_default β¨ β the Erlang module definition, but make it a vibe π
okay so bestie, this is a page from the stdlib docs, and honestly? it's giving "the shell's secret little helper module" energy. we're talking shell_default from Erlang, and it is literally about customizing your Erlang environment. let's get into it π
πΈ NAME πΈ
shell_default β customizing the Erlang environment, periodt. that's the whole thing. π
π¦ 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 magic. β¨
consider the following shell dialog, bestie β memorize this, it's iconic:
1> lists:reverse("abc").
"cba"
2> c(foo).
{ok, foo}
so in command one, module lists is called β you named it, so the shell goes straight there, no detours. but in command two, no module name is specified π and the shell does this whole little search thing: it looks in module user_default first, and then it searches module shell_default for function c/1. iykyk π«Ά
now, the vibes of each module are very different and i need you to understand this:
shell_defaultis for "system wide" customizations to the shell β think big, think everyone, think main character energy for the whole system πuser_defaultis for "local" or individual user customizations β that one's yours, it's personal, it's your little corner πΈ
π‘ HINT π‘
want to add your own commands to the shell? obsessed, let's go, here's the recipe π
create a module called user_default and add the commands you want in it. then add the following line as the first line in your .erlang file in your home directory:
code:load_abs("$PATH/user_default").
and $PATH? that's the directory where your user_default module can be found. don't forget it, bestie, or nothing loads and you'll be like π
fr fr: that line goes first in your .erlang file. first. no cap. π
okay that's the whole page and honestly it ate π
this was shell_default, from good old Ericsson AB, part of stdlib version 4.3.1.3, dated shell_default(3erl) β that's the source/version/date lineup, and no i'm not copying the footer line verbatim, i'm just giving it a cute little shoutout on the way out π¦ mwah, go customize your shell, you got this πβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms