the shell interprets special characters before processing the (Hosting your own web site)
the shell interprets special characters before processing the value. Rather thanuse single quotes, this time you use the same example with double quotes: echo Hello, my name is $USER Notice what the output is this time. Rather than display the exact text youprovided, the shell replaces the variable name, designated with a dollar sign, with the actual value stored in that variable. Why did I use single quotes in the PS1 example? The items with the back- slashes () are interpreted one way or another. However, if you use doublequotes with PS1, they re interpreted only once, so that item that lists whatdirectory you re in changes only the first time. With a single quote, the vari- ables are interpreted every time you do something. The double-quote exam- ple shows something like Hello, my name is bob. However, the singlequote comes up with Hello, my name is $USER. If you re going to play around with environment variables, I recommend thatyou start by using the methods I discuss in this section. After you have decidedthat you re comfortable with any changes you have made, you can make yourchanges permanent by opening the ~/.bash_profilefile and adding thesame text there. The next time you log in, the changes go into effect. You canmake changes for all your users profiles in /etc/profileas well. If you experiment heavily with these files, create a separate user account sothat you can do whatever you want without messing up your own login. Thisadvice especially goes for /etc/profile. You can damage everyone s loginswith this one! To create a separate /etc/profile, you can make a backup by typing cp /etc/profile /etc/profile.original. Then, edit /etc/ profileknowing that you can always delete it with the rmcommand and usethe mvcommand to rename /etc/profile.originalto /etc/profile. Don t be too discouraged if you don t understand all this variable stuff rightnow. As you become more proficient with Linux, you should explore shellscripting.Shell scripting is the art of creating computer programs with justthe shell. Most Linux and Unix administrators speak shell script language like you and I speak our native tongues. Using Redirection and PipesRedirection and pipes facilitate the flow of information. A pipeis exactly whatit sounds like: It directs the output of one program to the input of anotherprogram. A pipeline may consist of several utilities plumbed together bypipes. At either end of this pipeline is, optionally, a redirection. 288Part III:Getting Up to Speed with Linux