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.
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.
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 BreakUsing HP-UX Commands
|
Top |