Environment, Environment Variables, and Inheritance

This section explains the concepts of the command execution environment and inheritance.

Environment

When the Linux kernel invokes a program, the kernel passes to the program a list comprising an array of strings. This list, called the command execution environment or simply the environment, holds a series of name-value pairs in the form name=value.

Environment Variables

When bash is invoked, it scans its environment and creates parameters for each name-value pair, assigning the corresponding value to each name. Each of these parameters is an environment variable; these variables are in the shell’s environment. Environment variables are sometimes referred to as global variables or exported variables. ...

Get A Practical Guide to Linux Commands, Editors, and Shell Programming, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.