Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Using Your HP Workstation > Chapter 16 Using Your Shell

Setting the Login Environment

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

When you log in, your shell automatically defines a unique working environment for you, which is maintained until you log out. Your environment defines such characteristics as who you are, where you are working, and what processes you are running. These characteristics are defined by values assigned to environment variables.

Your shell environment is analogous to an office environment. In the office, physical characteristics like lighting and temperature are similar for everyone. But many factors in your office environment are unique to you, such as your routine tasks and your individual workspace. Thus, your work environment is different from that of your co-workers—just as your shell environment is different from theirs.

The login Program

When you log in, HP-UX runs a program named login. This program starts your session using data stored in the /etc/passwd file, which contains one line for each system user. This file includes your user name, password (in encrypted form), home directory, and the shell to run when you log in. If /etc/passwd doesn't specify a shell, the POSIX Shell (/usr/bin/sh) is selected.

The login program does the following:

  • Display the Password: prompt (if you have a password).

  • Verify your user name and password in the /etc/passwd file.

  • Assign default or user-defined values to the shell environment.

  • Start executing the shell process.

Environment Variables

The shell environment defines how HP-UX interacts with you. The environment's characteristics are defined by environment variables, which consist of a name and a value. For example, the directory in which you begin each session is your home directory; its environment variable is the variable named HOME, and its value is assigned during the login process. Throughout this section, the value of HOME is equal to /home/terry.

Here are some environment variables set during the login process. Note that most of these will already be set in your default .profile file.

HOME. 

  • Defines the user's home directory; the default directory for the cd command (for example, /home/terry).

  • Default value assigned during login.

LOGNAME. 

  • Contains the user name (for example, terry).

  • Default value is username

MAIL. 

  • Determines where the system looks for mail. Set based on the user name (for example, /var/mail/terry).

  • Typical default value is /var/mail/username

PATH. 

  • Sets the directories through which the system searches to find and execute commands.

  • Typical default values include the following paths:

       /usr/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin:/usr/lib
    

SHELL. 

  • Determines which shell to run. Set to the last field in the /etc/passwd file entry for the user logging in. If this field is not defined, the default value is used.

  • Typical default value is /usr/bin/sh

TERM. 

  • Specifies the kind of terminal for which output is prepared.

  • Typical default value is hp

TZ. 

  • Provides the current time zone and difference from Greenwich Mean Time. Set to Mountain Standard Time by default; your system administrator should change the value if you are in another time zone. Set by the script /etc/profile.

  • Typical default value is MST7MDT

EDITOR. 

  • Determines the default editor.

  • Typical default value is vi

DISPLAY. 

  • Specifies window display host. Use on a remote system to display windows locally.

  • Typical default value is DISPLAY=local:0

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© © 1983-1995 Hewlett-Packard Development Company, L.P.