Exploring Environment and Shell Variables

The two types of variables are environment variables and shell variables. Environment variables are variables defined in the current shell session and are available to any programs executed within that session. Environment variables often control how programs work. For example, you might set a LANG environment variable that other programs can use to determine the language a program should use to communicate with you. Shell variables are similar, except they’re not available to programs and subprocesses. You can think of environment variables as global variables, and shell variables as local ones.

The env command shows you all the environment variables that are set. A lot’s there, so pipe the results ...

Get Small, Sharp Software Tools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.