As described in more detail in Chapter 10, each running process has environment variables. Environment variables are name/value pairs, and a few of the variable names have meaning that is important to C programmers. (Many are used primarily for shell programming as quick alternatives to running programs that call library functions; those we do not describe here.)
EDITOR or VISUAL
EDITOR, or VISUAL if it is set, provides the user's preference for which text editor to use to edit text files, if your program requires asking the user to edit a text file. The reason for having two different variables comes from the days when EDITOR would be used on a paper teletype machine and VISUAL on a full-screen terminal.
Provides a colon-separated path of directories to search through to look for libraries. It should normally not be set, because the system file /etc/ld.so.conf provides the default path. You are unlikely to have to modify it in your programs; it provides information for the system run-time linker, ld.so. However, as documented in Chapter 8, it can be useful while developing shared libraries.
Lists libraries to load in order to override symbols in system libraries. LD_PRELOAD, like LD_LIBRARY_PATH, is described in more detail in Chapter 8.
Provides a colon-separated path of directories to search through to look for binary programs to run. Note that unlike some operating systems, Linux (like all variants of Unix) does not automatically search the current working directory for binaries; for an automatic search, the path must include the directory ".". Chapter 10, pages 125-127, describes how this works in detail.
Provides information on which type of terminal the user is using; this determines how to position characters on the screen. Chapter 24 and Chapter 21 describe this in more detail.