home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeBook TitleSearch this book

3.6. Customization Hints

You should feel free to try any of the techniques presented in this chapter. The best strategy is to test something out by typing it into the shell during your login session; if you decide you want to make it a permanent part of your environment, add it to your .profile.

A nice, painless way to add to your .profile without going into a text editor makes use of the print command and one of the Korn shell's editing modes. If you type a customization command in and later decide to add it to your .profile, you can recall it via CTRL-P or CTRL-R (in emacs-mode) or j, -, or / (vi-mode). Let's say the line is:

PS1="($LOGNAME !)->"

After you recall it, edit it so that it is preceded by a print command, surrounded by single quotes, and followed by an I/O redirector that (as you will see in Chapter 7) appends the output to ~/.profile:

print 'PS1="($LOGNAME !)->"' >> ~/.profile

Remember that the single quotes are important because they prevent the shell from trying to interpret things like dollar signs, double quotes, and exclamation points.

You should also feel free to snoop around other peoples' .profile files for customization ideas. A quick way to examine everyone's .profile is as follows: let's assume that all login directories are under /home. Then you can type:

cat /home/*/.profile > ~/other_profiles

and examine other people's .profile files with a text editor at your leisure (assuming you have read permission on them). If other users have environment files, the file you just created will show what they are, and you can examine them as well.

Finally, be sure that no one else but you has write permission on your .profile and environment files.

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.