beautypg.com

Environment variables – HP NonStop G-Series User Manual

Page 45

background image

Table 8 Variables (continued)

Description

Variable

Returns a random integer between 0 and 32767. Initialize by assigning a numeric
value to RANDOM.

RANDOM

Uses values set by the shell select function and by the read command when no
arguments are supplied.

REPLY

Returns the number of seconds the current shell process has been running.

SECONDS

Specifies the pathname for the shell. (The default value is /bin/sh.)

SHELL

Specifies the type of terminal you are using. (The default value is xterm.)

TERM

When set to a value greater than 0, specifies the number of seconds the shell will
run before it terminates if a command is not entered.

TMOUT

Determines the visibility of the Guardian /G and Expand /E filesets to the following
commands: chgrp, chmod, chown, cp, find, ls, mv, pax, and rm.

UTILSGE

Specifies the default editor. (The default value is vi.)

VISUAL

The following environment variables are set automatically by the shell; you do not have to specify
values for them:

ERRNO
LINENO
LOGNAME
OLDPWD
OPTARG
OPTIND
PPID
PWD
RANDOM
REPLY
SECONDS

These variables do not have initial (default) values; instead, their values are active and taken by
the shell as they change.

Environment Variables

The /etc/profile file and the .profile file in your home directory define local environment
variables. These variables are used by your shell as well as by any subshells and subprocesses
that are created. The .profile file also defines user definitions such as aliases and paths.

The .profile file must be in the user’s home directory.

The definitions you place in .profile are executed after the /etc/profile file is read.

If a variable is defined in both the /etc/profile file and the .profile file, the value defined
in the .profile file supersedes the value in the /etc/profile file.

You are not restricted to putting your environment variables in /etc/profile and .profile.
The file .kshrc is frequently used for environment variables. You must specify the file’s pathname
as an argument to the environment variable ENV.

Use the .kshrc file only for variables, aliases, paths, and other environment information. Do not
use it for holding data, program code, or applications.

Following is a list of the variables that you or the system administrator can add to the
/etc/profile

file and the .profile file. The default value listed in

Table 9

refers to the

/etc/profile

file and can be changed by the system administrator.

Environment Variables

45

This manual is related to the following products: