Customizing Your .profile

When you start the OpenExtensions shell, it uses two levels of environment variables to meet your particular needs or preferences as a user. The first level is a default systemwide user environment that is established when the shell executes /etc/profile, the system-wide login script for the shell. The system programmer may modify the variables in this file to reflect local needs (for example, the time zone). If you do not have an individual user profile, the values in /etc/profile are used during your shell session.

The shell also executes an individual login profile called the $HOME/.profile file (where $HOME is a variable for the home directory for your individual user ID). Any values in the .profile file in your home directory that differ with those in /etc/profile override them during your shell session. Your administrator may set up such a file for you, or you may create your own.

Typically, your .profile might contain the following:
Figure 1. A Sample .profile
      ENV=$HOME/.setup
      export ENV                  #export env variable
      PATH=$PATH:$HOME:
      EDITOR=ed
      PS1='$LOGNAME':'$PWD':' >'

      export PATH EDITOR PS1      #export global variables
If the value on the right-hand side of the = sign does not contain spaces, tab characters, or other special characters, you can leave out the single quotation marks.
ENV=$HOME/.setup
Identifies .setup in your home directory as your login script. See Customizing Your Shell Environment: The ENV Variable for more information about a login script.
export ENV
Specifies whenever a subshell is created, the ENV variable should be exported to it. See Exporting Variables for more information about exporting variables.
PATH=$PATH:$HOME:
Identifies the search path to be used when locating a file or directory. Here, the system first searches the path identified in the PATH variable in /etc/profile, the system profile; it then searches your home directory. See Customizing the Search Path for Commands: The PATH Variable for more information.
PS1='$LOGNAME':'$PWD':' >'
Identifies the shell prompt that indicates when the shell is ready for input. Here the prompt (default is $) has been customized to show your login name and working directory. For example, for user ID turbo working in the home directory, the prompt would display as:
turbo:/u/turbo: >
When turbo changes directories, the prompt changes to indicate the working directory.
EDITOR=ed
Identifies ed as the default editor used by some of the utilities, such as mailx.
export PATH EDITOR PS1
Specifies whenever a subshell is created, these variables should be exported to it. See Exporting Variables for more information about exporting variables.

If you create a subshell with the command sh –L, the shell starts and reads and processes your profile file. The shell looks for .profile in the working directory; therefore, make sure that you are working in the right directory when you enter this command.