z/OS UNIX System Services Planning
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Customizing /etc/profile

z/OS UNIX System Services Planning
GA32-0884-00

The /etc/profile file is the system-wide profile for the z/OS shell users. It contains environment variables and commands used by most shell users. To improve system performance, use STEPLIB=none.

Note: Because /etc/profile is the z/OS shell equivalent to /etc/csh.login for tcsh, you must keep system-wide information for both sets of users in synch. Any customization that you have done for /etc/profile (such as setting environment variables) must be duplicated in C-shell syntax in /etc/profile. Future changes to /etc/profile also must be made to /etc/csh.login. If you maintain a non-z/OS UNIX system, you could consider porting /etc/profile

and /etc/csh.login from that system to the z/OS system and merging them with the z/OS samples.

Copy the IBM-supplied /samples/profile file to /etc/profile. (See Steps for customizing /etc/profile for the procedure.) The following extract shows an excerpt of /samples/profile.

# ======================================================================
#                    STEPLIB environment variable
#                    ----------------------------
# Specifies a list of data sets to be searched ahead of the normal
# search order when executing a program. To improve the shell's
# performance for users from ISPF or users with data sets allocated to
# STEPLIB DD statements, specify "STEPLIB=none" .
# This performance improvement is not applicable to non-interactive
# shells, for example those started with the BPXBATCH and OSHELL
# utilities.
# The exec will restart the current shell, as a login shell with the
# same argv[0] name.  
# ==================================================================

if [ -z "$STEPLIB" ] && tty -s;
then
       export STEPLIB=none
       exec -a $0 $SHELL
fi

# ======================================================================
#                      TZ environment variable
#                      -----------------------
# Specifies the local time zone.
# =====================================================================
TZ=EST5EDT
export TZ
# ======================================================================
#                     LANG environment variable
#                     -------------------------
# Specifies the language you want the messages to displayed in.
# For Japanese: LANG=Ja_JP
# ======================================================================
LANG=C
export LANG

# ======================================================================
#                   LOGNAME environment variable
#                   ----------------------------
# This environment variable is set when 'logging' into the shell
# environment. You can avoid accidental modification to this variable
# by making the LOGNAME variable read-only.
# ==================================================================
readonly LOGNAME

# ======================================================================
#                     PATH environment variable
#                     -------------------------
# Specifies the list of directories that the system searches for an
# executable command. If you want to include the current working
# directory in your search order, then the enviroment variable would
# be
#   PATH=/bin:.

#
# The current working directory is represented by dot ('.') .
# =================================================================
PATH=/bin
export PATH# ======================================================================
#                    LIBPATH environment variable
#                    ----------------------------
# Specifies the list of directories that the system searches for a DLL
# (Dynamic Link Library) filename. If not set, the current working
# directory is searched.

LIBPATH=/lib:/usr/lib:.
export LIBPATH

# ==================================================================
##                    NLSPATH environment variable
#                     --------------------------–-
# Specifies the list of directories that the system searches for
# message catalogs (NLS files). The %L represents the language currently
# set by the LANG environment variable, and %N represents the name
# of the message catalog.
# ================================================================

NLSPATH=/usr/lib/nls/msg/%L/%N
export NLSPATH

# ======================================================================
#                    MANPATH environment variable
#                    ----------------------------
# Specifies the list of directories that the system searches for man
# pages (help files). The %L represents the language currently set by
# the LANG environment variable.
# ======================================================================
MANPATH=/usr/man/%L
export MANPATH

# ======================================================================
#                     MAIL environment variable
#                     -------------------------
# Sets the name of the user's mailbox file and enables mail
# notification.
# ========================================================
MAIL=/usr/mail/$LOGNAME
export MAIL

# ======================================================================
#                           umask variable
#                           --------------
# Sets the default file creation mask - reference umask in the z/OS
# UNIX System Services Command Reference
# ======================================================================
umask 022# ======================================================================
# Start of c89/cc/c++ customization section
# ======================================================================
#
#   The following environment variables are used to provide information
#   to the c89/cc/c++ utilities, such as (parts of) data set names which
#   are dynamically allocated.
#
# ######################################################################
#
# for _CMP in _C89 _CC _CXX; do
##
# High-Level Qualifier "prefixes" for data sets used by c89/cc/c++:
# ======================================================================
#
##  C/C++ Compiler:
#   ----------------------------------------
#   export ${_CMP}_CLIB_PREFIX="CBC"
##
#   Prelinker and runtime library:
#   ----------------------------------------
#   export ${_CMP}_PLIB_PREFIX="CEE"
##
#   z/OS system data sets:
#   ----------------------------------------
#   export ${_CMP}_SLIB_PREFIX="SYS1"
#
#
# Compile and link-edit search paths:
# ======================================================================
##
#   Compiler include file directories:
#   ----------------------------------------
#   export ${_CMP}_INCDIRS="/usr/include /usr/lpp/cbclib/include"
##
#   Link-edit archive library directories:
#   ----------------------------------------
#   export ${_CMP}_LIBDIRS="/lib /usr/lib"
##
# Esoteric unit for data sets:
# ======================================================================
##
#   Unit for (unnamed) work data sets:
#   ----------------------------------------
#   export ${_CMP}_WORK_UNIT="SYSDA"
##
# done; unset _CMP
#
# ======================================================================
# End of c89/cc/c++ customization section

Some of the statements in /etc/profile are explained in the following list:

STEPLIB=none
Indicates that STEPLIBs should be not propagated. Running the shell with STEPLIB=none assumes that the Language Environment® runtime library resides in LINKLIST or in LPA. It is run only on the first invocation of an interactive shell.
exec -a $0 $SHELL
Restarts the current shell in the current address space with the environment variables that you have just defined. The "if test" causes this to be run only on the first invocation of an interactive shell. The tty -s test prevents the shell from being run by noninteractive invocations such as those started with BPXBATCH and OSHELL.
TZ=EST5EDT
Sets the time zone as appropriate. In the sample profile, TZ is set to EST5EDT, which is Eastern Daylight Time.
LANG=C
Specifies the name of the default locale. C specifies the POSIX locale and Ja_JP specifies the Japanese locale.
readonly LOGNAME
Sets the LOGNAME variable to read-only so that it is not accidentally modified.
PATH=/bin
Sets a default command search path to search only the /bin directory.
LIBPATH=/lib:/usr/lib:.
Specifies the directory to search for a dynamic link library (DLL) file name. If this is not set, only the working directory is searched.
NLSPATH=/usr/lib/nls/msg/%L/%N
Sets the path for message catalogs.
MANPATH=/usr/man/%L
Sets the path for the man pages.
MAIL=/usr/mail/$LOGNAME
Sets the name of the system mail file and enables mail notification.
umask 022
Sets the default file creation mask. In the sample, the mask is set to 022. This causes a file created with mode 777 to have permissions of 755. The creator cannot set the group write or other write bits on in the file mode field, because the mask sets them off.
export TZ PATH NLSPATH MAIL LANG
Exports the values so the system will have access to them.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014