Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Linux System Environment > The Process Environment

9.1. The Process Environment

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 VISUALEDITOR, 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.
LD_LIBRARY_PATHProvides 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.
LD_PRELOADLists 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.
PATHProvides 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.
TERMProvides 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.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint