1.5 Shell Startup Files

   

When you log into HP-UX, some commands are executed automatically and the environment is set for you (e.g., setting of variables that control the behavior of your shell). As an example, the history length is set at the login time. Similarly, it is possible to set how your shell prompt should appear, which printer should be used for your print requests , in which directories the shell should look for extrinsic commands you issue, and so on. All this is done through shell startup files. If you have a DOS or Windows background, these files can be considered as the AUTOEXEC.BAT file in DOS or the Startup Group in Microsoft Windows.

There are two types of startup files: the system startup file and the user startup files. The system startup file is common for all users of the system, while user startup files can be customized for every user.

System Startup File

The system startup file is used for tasks that are common to all system users. Examples of these tasks are setting your time zone ( TZ ), and the global search path for extrinsic commands. The system startup file is called profile and is present in the /etc directory of HP-UX. It is the responsibility of the system administrator to manage this file and make it more useful, keeping in mind a particular UNIX environment. The system startup file can also be used by a system administrator to send messages that are displayed to users as soon as someone logs into the system.

User Startup File

The user startup file is called .profile ("dot profile") and is placed in a user's home directory. This file is used for user-specific tasks, such as setting shell aliases, and for executing any programs that a user wants to start soon after login. A typical example of such a program is a customized environment used for database operators in which a form is displayed for entering data into the database. This file can also be used to change or modify some of the environment settings made by the superuser in the system startup file.

The system startup file is executed first in the startup procedure, and then the user startup file is executed. In addition to these two files, an HP-UX user can execute another file pointed to by the ENV variable if it is set in either of the two startup files.

Study Break

Using HP-UX Commands

Log in using the user name assigned to you and change your password. Try a new password fewer than six characters . Also try using a password containing all letters . Check if the system date and time are correct. Find out the name of your home directory using the pwd command. List files in your home directory with the ls -a command and write down the names of files that start with a dot (.) character. Create an alias for this command. Before logging out, use the history command to list all of the commands you have used.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

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