Source Compatibility Guide

Using the Compatibility Package

You can make use of the compatibility package in several ways: permanently, temporarily, or on a case-by-case basis.

To always get the compatibility package version of a command, you must set your PATH environment variable so that /usr/ucb appears before /usr/bin.

The following command displays the current setting of your PATH environment variable:

$ echo $PATH
/home/medici/bin:/usr/bin:/usr/ucb:/etc:.
$ 

For the current shell to find the compatibility package commands by default, switch the order of /usr/bin and /usr/ucb:

$ PATH=/home/medici/bin:/usr/ucb:/usr/bin:/etc:.
$ 

To make this change permanent, put the above line in the .profile file in your home directory.


Note -

If you're using the C shell, use the following command to switch the order of /usr/bin and /usr/ucb. To make this change permanent in the C shell, put this line in the .cshrc file in your home directory. Changes to the .cshrc file do not take effect until that file has been sourced. See csh(1) for more information.


% set PATH=(/home/medici/bin /usr/ucb /usr/bin /etc .
% 

You can keep the SunOS 5.x commands as your default and still access the compatibility package commands by specifying the command's full path. This is useful when you are interested in the compatibility package version of a particular command only for a given instance:

$ which df
/usr/bin/df
$ df
/        (/dev/root	):	231024 blocks	 105323 files
/proc    (/proc	):	          0 blocks	 123 files
$ /usr/ucb/df
Filesystem	  kbytes  	used	    avail	  capacity  	Mounted on
/dev/root   	1750592 	826496	  749032 	52%	       / 

Compatibility package header files and libraries used by the compatibility package version of the C compiler (cc) and linker (ld) are located in /usr/ucbinclude and /usr/ucblib.

By setting your path as shown above, you'll use /usr/ucb/cc when you compile C programs. /usr/ucb/cc sets its default paths to pick up the following directories in the order specified:

  1. User-specified include directories and libraries.

  2. The compatibility include files and directories.

  3. The base SunOS 5.x system headers and libraries, if unresolved symbols remain.