Edward Alfert
Although every care has been taken to provide accurate information, I do not warrant the accuracy or completeness of the information included in this website. Any use, or reliance on, such information is entirely at user's own risk.

HP-UX Environment Setting Up the User Environment

The user environment is configured by editing /etc/profile and {$HOME}/.profile files.

Global Settings

/etc/profile is used for settings that you want to apply to every user.

The following is the unmodified /etc/profile script.

Lets change the prompt from # or $ to something more useful. This can be done by setting the value of PS1.

I want to configure a prompt that displays the current user, name of the system, and the current directory path.

Add the following to the end of the /etc/profile script.

The only problem with the above is that if you are in a very long directory path, you will have very little room to see the command you are typing because the line does not wrap if you reach the right side of the screen. You can get useful information by just displaying the last two directories of the current path. If you ever need to know the current complete path, just issue the pwd command.

#

User Specific Settings

{$HOME} is the user's home directory which by default is /home/{$USERNAME}/ where {$USERNAME} is what the user typed at the login: prompt.

{$HOME}/.profile - used for overriding or adding to global settings and only apply to one user.

Don't include the current directory in search path

Choose a job you love and you will never work a day in your life. - Confucius