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

Chapter 9: Working Environment

9.2 Some Important Variables

These variables are important for all shells, unless noted otherwise.

DISPLAY

In order to use an X windows application, the environment variable $DISPLAY must be set correctly. Normally the Fermi login files set it correctly for you. Its value is of the form node:screen.server. At Fermilab, this will generally look like node.fnal.gov:0.0 where node is your machine name.

Finding the value of name is different on different types of terminals and workstations:

UNIX workstation

On a local window, run funame -n to get the name.

NCDX terminal

("X-terminal") Use the TCP/IP Name found under Show Version from the startup menu.

Tektronix X terminal

Enter setup by pressing F3 (the setup key). Select setup. Under Configuration Summaries, select TCP/IP. A screen appears with the nodename. This is the name you want.

VMS workstation

If the workstation is connected directly to the monitor, then use the name of the workstation.

HOME

Your home directory is the top of your personal branch in the file system, and is usually designated by your username, i.e. /{path}/{username}. The value of the variable HOME is the pathname of your home directory. The command cd without arguments always returns you to $HOME. In all shells except sh, the tilde (~) symbol used in filename expansion, expands to the value of this variable. For example ~/myfile is equivalent to $HOME/myfile. ~{username} is equivalent to the $HOME directory of user {username}.

PATH

The PATH variable lists the set of directories that the shell looks in to find the commands that you enter on the command line. (For the C shell family, the shell variable path takes its value from PATH.) If the path is set incorrectly, some commands may not be found. If you enter a command with a relative or absolute pathname, the shell will only search that pathname for it, and not refer to PATH.

If you include the current working directory, "dot" (.), in your PATH, the shell will always find your current working directory. This allows you to run executable files from your current working directory by typing in only the filename. The Fermi login files include the dot at the end of the path for you.

For the C shell family, see the following line in the setpath.csh file (see section C.1.3):

set path = ($path .)

For the Bourne shell family, see the following line in the setpath.sh file (see section C.2.3):

PATH = ${PATH}.:

See section 9.4 for information on these files. If "dot" is not in your PATH, then in order to execute a file, you need to precede the executable filename by ./ on the command line. This provides the current directory pathname explicitly.

LINES and COLUMNS

These variables control the number of lines and columns are displayed on your screen. The csh family syntax is:

% setenv LINES n
% setenv COLUMNS n

to set the number of lines or columns to n.

[Missing image]Note for Solaris (SunOS 4.x) and OSF1: Use instead:

% stty -rows n
% stty -cols n

MANPATH

The MANPATH variable lists the set of directories that the shell looks in to find man pages.

SHELL

This variable is set to your default shell. Your default shell is determined by the last field in your password entry (see section 4.1.2).

ignoreeof

This shell variable is in csh, tcsh, ksh and bash. sh doesn't have it. When the ignoreeof variable is set, you cannot exit from the shell using <Ctrl-d>, so you cannot accidentally log out. You must use exit or logout to leave a shell (see section 2.2).

noclobber

This shell variable is in csh, tcsh, ksh and bash. sh doesn't have it. With the noclobber variable set, you are prevented from accidentally overwriting a file when you redirect output. It also prevents you from creating a file when you attempt to append output to a nonexistent file.

noclobber has no effect on utilities such as cp and mv. It is only useful for redirection. See sections 5.4.2 and 6.3.


UNIX at Fermilab - 10 Apr 1998

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