There are some standard variables that many HP-UX commands use. These are called predefined because their names are standard. Here are some of these variables and their use by different commands.
PATH is the most commonly used environment variable. It contains the command search path or name of directories where your shell searches for a command when you issue it. Usually it is set up through the system startup file ( /etc/profile ) and can be modified by a user to add personal directories through the user startup file ( .profile ). Each directory in the PATH variable is separated by a colon .
HOME is automatically set when a user logs into HP-UX. It contains the path of the user's home directory. To refer to the .profile file in your home directory, you can use $HOME/.profile as the complete path to the file. Please note that there is another way to refer to your home directory in HP-UX, and that is the ~/ combination.
PWD shows the current directory. It is also set automatically whenever you use the cd command. It always has the value of the current directory.
SHELL shows the absolute path of your login shell. It is automatically set at the login time.
TERM contains the name or type of your terminal. It is usually set through the /etc/profile shell startup file using the tset or ttytype command.
PS1 contains the primary command prompt string. This string is displayed in your shell prompt. If $ is displayed as your command prompt, the value of PS1 is a $ symbol.
PS2 contains the secondary command prompt string. That is, if you issue a command that is incomplete, you will see a prompt by the shell with a value of PS2.
MANPATH contains the list of directories where the man command looks for manual pages. A colon separates each directory in the list.
TZ contains the local time zone that was set at the time of HP-UX installation. Commands such as date read this variable.
EDITOR contains the name of the editor you want to use for command line editing or for typing mail messages. You can set this variable in your shell startup file with your favorite editor.
HISTFILE contains the name of the history file where your command history is kept. All of the commands you use go to the history file.
HISTSIZE variable shows how many commands are kept in the history file.
Study BreakPredefined Environment Variables
|
Top |