The .profile script

The .profile Script

The .profile file can contain any commands and environment settings that a normal shell script can.

The values of all shell variables can be set in .profile . For example, if we wanted to set the current terminal type to VT220, we would insert the following environment variable definition into the .profile file:

 TERM=vt220; export TERM 

In this example, the TERM variable is created and the value vt220 assigned to it. At this point, the scope of the variable is just the .profile script itself. In order to ensure that the value is exported to shell proper, the export command should be used as shown.

Since many environment variables are set system-wide (such as the location of database files), each user will expect to have variables consistently set. One way to ensure that users are using the correct variables is to define the /etc/skel/profile.local file. This skeleton file contains variable definitions that will be copied to new users accounts when they are created with admintool or useradd.

Exercise 11-1     Check the environment variables that are set in your current shell.

 
 
   


Sun Certified Solaris 9.0 System and Network Administrator
Sun Certified Solaris(tm) 9 System and Network Administrator All-in-One Exam Guide
ISBN: 0072225300
EAN: 2147483647
Year: 2003
Pages: 265
Authors: Paul Watters

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net