
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[previous article] [next article]David Curry
The following article is a reprint of a portion of ECN 199-E, Migrating To Solaris And The Common Unix Environment. To obtain a copy of the complete document, please contact your site specialist.
The search path is the list of directories in which your shell looks for commands to execute. The default search path is set for you automatically by the system, and given to your shell when you log in. You can use your shell startup files (.profile, .cshrc, .login) to add directories to, delete directories from, and rearrange the order of your search path.
The changes described in this section will become effective as follows:
Existing Solaris systems: These changes will become effective on systems currently running Solaris when they are upgraded to Solaris 2.3 over the Christmas 1993 break.
SPARC SunOS systems: These changes will become effective on SPARC (Sun-4) systems running SunOS when they are converted to Solaris in Summer 1994.
In the past, the ECN staff has replaced certain commands in this layer with local versions of the same commands. While this at times provides added functionality, it makes our systems incompatible with other UNIX systems. Beginning with the migration to Solaris, the ECN staff will not replace commands in this layer with local versions (except in three cases where it is unavoidable). Instead, the local versions of these commands will be placed in the Common UNIX Environment Software layer, which precedes the UNIX Operating System Software layer in the default search path. In this way, ECN users will still receive the added-functionality version of the command, but the standard version of the command will be available to those who need it.
In order to provide a more standard environment, one that is consistent with established conventions in the UNIX community, the Common UNIX Environment Software layer specifies that locally-maintained software (both locally-developed and public domain) will be installed in the directory /usr/local/bin. (Basically, this means that /usr/ecn is being renamed /usr/local/bin.)
Because the above change conflicts with the current use of the name /usr/local, and in order to make the distinction between CUE -supported and site-specific software more clear, site- specific software is now contained in the Site-Specific Software layer, described shortly.
Pnews flex merge project shar Rnmail flost mh protoize strip7 X11R5 g++ mk ps4014 sx archive gcc mkcmd ps630 sz bison gdb newsetup pscat talk checknews ghostview newsgroups pscatmap tclhelp checn gr nn psdit tclsh chfn gs nnadmin psfig tclshx chkacct ident nncheck pslpr tip chsh inews nngoback psnup tn3270 ci kermit nngrab psplot turnin cleanscript labstat nngrep psroff unprotoize co learn nnpost ptroff unrm colcrt less nnquery qplot webster connect lesskey nnstats rb wish cue lname nntidy rc wishx des lprint nnusage rcs wxp_wx emacs lwah pbm rcsmerge wxproot enscript lwinfo perl readnews wxptxt etags lwpages ph rlog xstart fax lwpasswd phone rn faxq lwq plot3d rx faxrm mailbox policy rz finger maketd postnews sbWithin the /usr/local/bin directory are four subdirectories: /usr/local/bin/X11R5
This directory contains the MIT X Window System, Version 11 Release 5 software.These software packages, because of the large number of commands in each, have been placed into subdirectories, since we do not expect everyone to use them. If you would like to make use of one or more of these packages, see the section on customizing your search path, later in this chapter./usr/local/bin/dwbThis directory contains the Documentor's Workbench versions of thetroff, eqn, tbl, pic,andgrap programs. /usr/local/bin/mhThis directory contains the RAND Mail Handler (MH) software, version 6.8.3./usr/local/bin/pbmThis directory contains the PBMPLUS image manipulation programs.
rm
and unrm commands developed by the Computer Center to provide the
same functionality (saving copies of deleted files for later
retrieval in case you make a mistake). Until this software is
ported to Solaris, you may wish to alias the rm command to rm -i,
which will prompt you for conformation before removing any files.
The Common UNIX Environment Software layer specifies that third- party (commercial) software will be installed in the directory /usr/opt/bin. The list of third-party software that will be a part of the CUE has yet to be determined. However, in order to begin the changeover to the CUE scheme, the ECN staff has installed the third-party software packages currently available for Solaris in /usr/opt/bin. As of the date on the cover of this document, the following third-party packages have been installed in /usr/opt/bin:Third-Party Software
Abaqus Island Draw Lotus 1-2-3 SPARCWorks Ansys Island Equation MATLAB Sun C AutoCAD Island Paint Maple Sun C++ CodeCenter Island Table Mathematica Sun FORTRAN Frame Maker Island Write ObjectCenter Sun Pascal IMSL Word PerfectAs the Solaris versions of other packages are received, they will be installed in /usr/opt/bin as well.
The ECN staff maintains two directories, /usr/local and /usr/custom, for the installation of site-specific software. This software is installed at one or two sites, but is not available at other sites. For example, the School of Electrical Engineering maintains a command calledThe Site-Specific Software Layer
eeph that prints phone numbers and
office assignments for EE faculty, staff, and graduate students.
This command is only available on EE systems. In part because the
/usr/local name is now used for other purposes (see the previous
section), and in part to provide new functionality, the Site-
Specific Software layer specifies that site-specific software
will be installed in /usr/site/
Thus, for example, on a system owned by the Agricultural Engineering department, the contents of the SunOS /usr/local and /usr/customdirectories would be merged and stored in /usr/site/agen/bin.School ______________________________________________ aaeAeronautics and AstronauticsagenAgricultural EngineeringcheChemical EngineeringceCivil EngineeringeeElectrical EngineeringengrFreshman EngineeringieIndustrial EngineeringideInterdisciplinary EngineeringmseMaterials EngineeringmeMechanical EngineeringnuclNuclear Engineering
When you log in to a system, the /usr/site/
Since the ECN and PUCC staffs do not support the software in /usr/unsup/bin, this directory will not be part of the standard search path on CUE systems. This is a notable change - /usr/unsup is a part of the standard search path on ECN SunOS systems. The change is being made because there has been a great deal of confusion about who supports the material in /usr/unsup, and many people have been relying on software over which the ECN staff has no control. By taking /usr/unsup/bin out of the standard search path, it becomes more evident that the software in this directory is not supported nor endorsed by the ECN or PUCC staffs.
/usr/local/bin:/usr/opt/bin:/usr/bin:\ /usr/site/sitename/bin:. on Solaris systems, and /usr/local/bin:/usr/opt/bin:/usr/ucb:\ /usr/bin:/usr/site/sitename/bin:.on SunOS systems. In both of these examples, sitename is the name of the site (school) that ``owns'' the particular system you are using.
When the ability to add additional sites' bins to your search path becomes available in Summer 1994, those directories will be placed into the search path immediately following the /usr/bini directory.
Example:. To add the directory /usr/unsup/bin to the end of your path, the following syntax is recommended:
Bourne/Korn shell (.profile):Example: To add the directory ~/bin (your own private directory of programs) to the front of your path, the following syntax is recommended:PATH=$PATH:/usr/unsup/bin export PATHC Shell (.cshrc/.login):set path = ( $path /usr/unsup/bin )
Bourne/Korn shell (.profile):Example: To add both ~/bin to the front of your path and /usr/unsup/bin to the end of your path, the following syntax is recommended:PATH=$HOME/bin:$PATH export PATHC Shell (.cshrc/.login):set path = ( ~/bin $path )
Bourne/Korn shell (.profile):If you have any questions about customizing your search path, contact your site specialist.PATH=$HOME/bin:$PATH:/usr/unsup/bin export PATHC Shell (.cshrc/.login):set path = ( ~/bin $path /usr/unsup/bin )
Manual pages are stored in the following directories on CUE systems:
/usr/man Manual pages for the UNIX Operating System Software layer. /usr/local/man, /usr/opt/man Manual pages for the Common UNIX Environment Software layer. /usr/site/Beginning in Summer 1994, CUE systems will set the manual page search path to include all four of these directories automatically. However, in the interim, you will need to set this value yourself, because the currently-installed software does not do it for you./man Manual pages for the Site-Specific Software layer.
To set your manual page search path, use a command such as the following:
Bourne/Korn shell (.profile):You may also wish to add the following directories to your manual page search path, depending on your needs:MANPATH=/usr/opt/man:/usr/local/man:/usr/man:\ /usr/site/sitename/man export MANPATHC Shell (.cshrc/.login):setenv MANPATH /usr/opt/man:/usr/local/man:\ /usr/man:/usr/site/sitename/manwhere sitename is the name of the site whose systems you normally use.
/usr/openwin/share/man Manual pages for the OpenWindows window system commands. /usr/local/X11R5/man Manual pages for the MIT X Window System, Version 11 Release 5 software. /usr/unsup/man Manual pages for the unsupported software.To do this, we recommend that you create a second line in your startup file that appends these directories to the default manual page search path you defined above. This way, when the software is modified to set the default manual page search path automatically, you can just delete the first line described above from your startup file, and everything will continue to work as you expect.
Example: To add /usr/unsup/man to your manual page search path, the following syntax is recommended:Bourne/Korn shell (.profile):
MANPATH=/usr/opt/man:/usr/local/man:\ /usr/man:/usr/site/sitename/man MANPATH=$MANPATH:/usr/unsup/man export MANPATHC Shell (.cshrc/.login):setenv MANPATH /usr/opt/man:/usr/local/man:\ /usr/man:/usr/site/sitename/man setenv MANPATH $MANPATH:/usr/unsup/man
Bourne/Korn shell (.profile):if [ -x /usr/5bin/uname ]; then version=`/usr/5bin/uname -s -r` else version=`/usr/bin/uname -s -r` fi case $version in SunOS 5.*) commands for Solaris... ;; SunOS 4.*) commands for SunOS 4.1... ;; esacC shell (.cshrc/.login):if ( -x /usr/5bin/uname ) then set version=`/usr/5bin/uname -s -r` else set version=`/usr/bin/uname -s -r` endif switch ( "$version" ) case "SunOS 5.1": case "SunOS 5.2": case "SunOS 5.3": case "SunOS 5.4": commands for Solaris... breaksw case "SunOS 4.1.1": case "SunOS 4.1.2": case "SunOS 4.1.3": commands for SunOS 4.1... breaksw endsw
One way to do this is to make subdirectories in your ``bin'' directory, one for each architecture. For example, you might have subdirectories called sun3, sun4, and sun4.solaris. You can use the uname -m command in your .profile, .cshrc, or .login to obtain the processor type (``sun3'' or ``sun4'') and the uname -s -r command to handle the operating system version. For example:
Bourne/Korn shell (.profile):There are other, equally valid ways to do this - the above is just one suggested method.if [ -x /usr/5bin/uname ]; then version=`/usr/5bin/uname -s -r` else version=`/usr/bin/uname -s -r` fi case $version in SunOS\ 5.*) bin=$HOME/bin/sun4.solaris commands for Solaris... ;; SunOS\ 4.*) bin=$HOME/bin/`uname -m` commands for SunOS 4.1... ;; esac PATH=$bin:$PATH export PATHC Shell (.cshrc/.login):if ( -x /usr/5bin/uname ) then set version = `/usr/5bin/uname -s -r` else set version = `/usr/bin/uname -s -r` endif switch ( "$version" ) case "SunOS 5.1": case "SunOS 5.2": case "SunOS 5.3": set bin = ~/bin/sun4.solaris commands for Solaris... breaksw case "SunOS 4.1.1": case "SunOS 4.1.2": case "SunOS 4.1.3": set bin = ~/bin/`uname -m` commands for SunOS 4.1... breaksw endsw set path = ( $bin $path )