When you log on to your system, whether it’s a shiny new Mac OS X Terminal app, a clean Linux install, or a Unix server in the back office, you’re effectively given your own copy of the shell program. This login shell maintains what’s known as your environment—a configuration that is distinct from other users on the system. This environment is maintained from the moment you log on until the moment you log off. In this chapter you’ll learn about the shell environment and you’ll see how it relates to writing and running programs.
Type the following program called
vartest into your computer:
$ cat vartest echo :$x: $
vartest consists of a single
echo command that displays the value of the variable
x surrounded ...