Default Shell Environment
As mentioned previously, when you log in and get a shell, a number of things happen: Certain files are read, some variables are set, and perhaps even a program or two are run. Most of what happens sets up your default environment. This environment is set via the previously mentioned files. A few, however, such as $HOME (a notation indicating a user's home directory—under bash, this can also be abbreviated as a tilde [~])—and $SHELL (which is the shell login called) are obtained from /etc/passwd, as is the UID.
Variables
Listing 14.1 shows a sample /etc/profile. As you can see, one of the first things set is PATH. Custom dictates that environment variables are always uppercase. You can always see how a particular ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access