DEPARTMENT OF COMPUTING

IT 1100 : Introduction to Operating Systems

Chapter 11 Modifying the Environment


Commands Covered

“The shell maintains a body of information during our shell session called the environment. Data stored in the environment is used by programs to determine facts about the system’s configuration. While most programs use configuration files to store program settings, some programs will also look for values stored in the environment to adjust their behavior. “


Commands Covered


System Config vs Single User Config

System configuration files are located in the /etc directory

User configuration files are located in users home directory

In the textbook chapter 11 still uses nano for its examples - you can follow the examples as written and get some nano experience or you can use vim.


The Environment

The shell stores two basic types of data in the environment, though, with bash , the types are largely indistinguishable. They are environment variables and shell variables . Shell variables are bits of data placed there by bash , and environment variables are basically everything else. In addition to variables, the shell also stores some programmatic data, namely aliases and shell functions .


Environment Variables

An environment is an area that the shell builds every time that it starts a session. The environment creates variables that will hold different system properties.


Environment Variable Types

These are summarized in Table 11-1 in the text.

We can use the echo command to display an environment variable but using a $:


Aliases


Establishing the Environment

When we log on to the system, the bash program starts, and reads a series of configuration scripts called startup files, which define the default environment shared by all users.


Types of sessions


Startup files for login shells


Startup files for non-login shells


More Shell stuff

To change environment variables:


After changing bash files


Textbook Time

Last Updated 03/27/2018