[Next] [Previous] [Up] [Top] [Contents] [Index]

Appendix B. UNIX Product Support (UPS) Overview

B.2 The UPS Environment

On a FUE-compliant system the standard default login files (also known as Fermi files[87]) set your environment to facilitate UPS operations, among other things. Regarding shells, UPS supports both UNIX shell families, C (Berkeley) and Bourne[88]. At login time, the environment variable UPS_SHELL gets set to indicate the family of the shell in use. Any shell within that family can then be used for UPS operations.

The Fermi files are designed for interactive use only and will break if they are called from a non-interactive script. You need to explicitly include the following actions in the order shown in any script that you will use to setup products (i.e. in which you use the setup command to access one or more products; setup is described in section 10.2.2):

For the C shell family:

source /usr/local/etc/setpath.csh

source /usr/local/etc/setups.csh

For the Bourne shell family:

. /usr/local/etc/setpath.sh

. /usr/local/etc/setups.sh

The setpath script sets a reasonable default starting path. The setups script (read "set UPS") sets the UPS environment variables described below[89].

The login files also set the alias for setup. Note that if you change shells or processes, this alias is no longer available to you. In this case you need to manually re-source the setups script in your new shell.

If you have made any changes to your login files, make sure that the following lines are still included before using UPS:

For the C shell family:

.cshrc includes

source /usr/local/etc/fermi.cshrc

.login includes

source /usr/local/etc/fermi.login

For the Bourne shell family:

.profile includes

. /usr/local/etc/fermi.profile

.shrc includes

. /usr/local/etc/fermi.shrc

Three environment variables get set by the setups script at login:

PRODUCTS

If only one UPS database is defined, this points to it; if two or more are defined, this variable can be set as the space-separated list of UPS databases. The order of the databases in this list reflects the order of precedence for accessing products.

UPS_DIR

This points to the top level directory (called the product root directory) of the current instance of UPS (read sections B.8 through B.10 -- they're short! -- to understand the term "current instance").

UPS_SHELL

As mentioned above, this indicates the shell family in use; it is set to either sh or csh.

You can use the environment variable PRODUCTS to list all the available products. For example, if it is set to the following list of UPS databases:

/home/dcdsv0_lv0/aheavey/ups_play/ups_database/declared

/usr/products/ups_database/declared

/afs/fnal/products/ups_database/declared

then the command:

% ls $PRODUCTS

will yield information similar to the following (edited for brevity)[90]:

/afs/fnal/products/ups_database/declared:

acrobat frame lund tcl

admintools fslib mad tclx

afsemu ftcl mailtools tex

...text removed...

flint ktevana softwindows xpdf

fmb lapack stdhep zephyr

fmss libgpp.obs systools

/home/dcdsv0_lv0/aheavey/ups_play/ups_database/declared:

cedit exmh fermitpu glimpse juke www

/usr/products/ups_database/declared:

altuascvs fulib lund qq tk www

chekker funkern mbone req tpu xemacs

conv2html futil mgui sdsscvs uas_build ximagetools

...text removed...

flint html ntp tcl upp

fmb ispell ocs tclx ups

fonts juke olscvs teleserver webservers

When you setup a product, the environment variable {PRODUCT}_DIR gets defined, where {PRODUCT} is the name of the product in upper case, for example WWW_DIR. This variable points to the root directory of the particular copy of the product that you setup; for example after running:

% setup www v2_7

the variable WWW_DIR is defined as something like /{ups_dirs}/products/SunOS+5/www/v2_7. You can then run a command like the following:

% ls -al $WWW_DIR

which returns a list of the files and subdirectories in the product root directory for www version v2_7, for example:

total 40

drwxr-xr-x 7 products g150 2048 Jun 19 18:54 .

drwxrwxrwx 5 root root 2048 Sep 9 23:16 ..

-rw-r--r-- 1 products g150 165 Jun 18 11:31 BUILD_INFO

-rw-r--r-- 1 products g150 4703 Oct 16 1995 Makefile

drwxr-xr-x 2 products g150 2048 Aug 9 18:19 bin

drwxr-xr-x 2 products g150 2048 May 5 1996 etc

drwxr-xr-x 2 products g150 2048 May 5 1996 include

drwxr-xr-x 4 products g150 2048 May 5 1996 lib

drwxr-xr-x 2 products g150 2048 May 5 1996 ups


[87] See Chapter 9 and Appendix C for descriptions and listings of the Fermi files.
[88] The C shell family includes csh and tcsh; the Bourne shell family includes sh, ksh, bash and zsh. zsh is not supported at Fermilab.
[89] These scripts are included in the FUE package systools.
[90] Notice that the ls command does not list the databases in the order of precedence according to the PRODUCTS variable, but rather, alphabetically.

UNIX at Fermilab - 10 Apr 1998

[Next] [Previous] [Up] [Top] [Contents] [Index]