This dichotomy begs an important question:
which shell "things" are known outside the shell, and which
are only internal? This question is at the
heart of many misunderstandings about the shell and shell
programming. Before we answer, we'll ask it again in a
more precise way: which shell "things" are known to subprocesses?
Remember that whenever you enter a command, you are telling
the shell to run that command in a subprocess;
furthermore, some complex programs may start their own
subprocesses.
The answer is actually fairly simple.
Subprocesses inherit only environment variables.
They are available automatically, without the subprocess having
to take any explicit action.
All the other "things" -- shell options, aliases, and functions -- must
be made explicitly available.
The environment file
is how you do this.
Furthermore,
only interactive shells process the environment file.
The next two sections describe environment variables and
the environment file, respectively.