O'Reilly logo

Shell Programming in Unix, Linux and OS X, Fourth Edition by Patrick Wood, Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Your Environment

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.

Local Variables

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required