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 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.