Unix 4 -- Unix Miscellaneous

Math 10 -- D. C. Smolarski, S.J.
Santa Clara University, Department of Mathematics and Computer Science

[Return to Math 10 Homepage | Return to Math 61 Homepage]
[Return to Unix 3 Page | Go to Unix 5 Page ]

Contents


Setting the Display Variable

The DISPLAY variable should contain the IP (internet network) address (or the equivalent host name) of the machine you are physically working on, as opposed to the name of the machine to which you are connected (which in most cases for the sake of Math 10 is called math.scu.edu or math for short (i.e., on campus).

It is important that this DISPLAY variable contain the correct value so that X-Windows is able to open up graphics and other windows which people are connected. The DISPLAY variable is automatically set when users connect to math using the CDE interface.

A user can automatically have the DISPLAY variable set if the .cshrc file (for C-shell users) contains the following line (on math):

     setenv DISPLAY `/bin/who -mR | sed 's/.*(\([a-z0-9.]*\).*/\1/'`:0
On pascal, -mR should be replaced by -ml.

NOTE that there is a difference between ' and ` and the two slashes. The first quote, ', is the one on the " key and the second quote, `, is the one on the ~ key.

You should check your .cshrc file to see if it contains this command. If not you should add it at the bottom of the file.

An alternative method is to check your IP address or node name via the command:

     finger -R
under the Where column and use the setenv, for example, as follows:
     setenv DISPLAY 129.210.40.47:0
or (using the node name)
     setenv DISPLAY ricci.scu.edu:0
However, this alternative method must be performed by hand each time you log in. The preferred method is to modify your .cshrc file.

NOTE: If you prefer to use the POSIX shell, the command must be put into your .profile or .login file rather than the .cshrc file and is included in a slightly different format. See the instructor or system manager for information.

Setting the Path Variable

The PATH variable indicates the system and local directories that are searched in order to find the programs a user wishes to use. The PATH is initially set by the system, and is expanded when a user logs in.

The PATH variable should also refer to the current directory to which a user is connected. The currect directory is indicated by a single period and the parent directory is indicated by two periods. In other words, the command

     cd ..
will change the directory to the parent of the one currently connectly in.

In the .cshrc file, there should be the following command:

     set path=(. $path )
which resets the system initialized path variable to also include the user's current directory.

NOTE: You should check this in your .cshrc file to see whether the period is present after the opening parenthesis, and insert it if it is missing!

Without this correction, you will not be able to execute code in your directory without a specific reference to the current directory. For example, instead of invoking

       prog1
you would have to type
       ./prog1
if the path variable is not set properly!

Easy Correction to Problems on math

If your initialization file (either .cshrc or .profile) are not correct regarding the PATH or DISPLAY initialization, one can copy the latest version of these files by typing the following at the system prompt:
      cp /etc/skel/.cshrc .
      cp /etc/skel/.profile .
The final period (preceded by a space) is necessary on each line and indicates that the preceding file is to be copied into the current directory and retain the same name. This will overwrite your current versions of these files. Any additions to these files you might have made will have to be re-enterred.
[Return to Math 10 Homepage | Return to Math 61 Homepage]
[Return to Unix 3 Page | Go to Unix 5 Page ]

This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
© Copyright 1998-2001 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 16 September 2001.