skip navigation

This page looks better in modern browsers. Please upgrade.

Brown Home Brown Home Brown Home Brown CS
next up previous
Next: Personal Environment Settings Up: The Modules System Previous: How to Use the

A Walkthrough of the Included Lines

OK, so what was all that? Here it is a few lines at a time:


if ($?tcsh) then

setenv SHELLNAME 'tcsh'

else

setenv SHELLNAME 'csh'

endif


This is, for csh or tsch, a way to set the SHELLNAME environment variable. This is the only shell-dependent line in the setup. Once the shell has been determined, the modules system can load the appropriate files, and your subsiquent files can be in a generic format that will be correct regardless of which shell you're using. Next, the SHELLNAME variable is used.


setenv MODULESHOME /opt/modules

source $MODULESHOME/init/$SHELLNAME


These two lines actually work to load the modules system. The second line uses the MODULESHOME variable to find the Init file, and then uses the SHELLNAME variable to pick the correct init file for your shell (supported shells are bash, csh, ksh, perl, sh, tcsh and zsh). When this file is loaded, a new function is added to your shell called module. Once you've logged in, try typing module in a shell. What are you doing is invoking a new shell function.


module use /opt/modules/lib

module use /opt/modules/lib/courses


These lines tell the modules system where to look for modules. If you want to include a new module, you'll need to make sure that the location of the module is included in the module use locations. The ``courses'' line lets your account load any modules that individual courses have made available.


module load osdetect

module load browncs.$ARCH cs.$ARCH news openwin


Finally, these are the lines that actually load the modules. After the module load appears a list of modules to include in your environment. The first line, which includes the osdetect module sets up some variables based on the operating system and hardware you are running on. This info is then used in the second line to load appropriate files.

The default set of modules incrementally loads most of the path, manpath and environment settings that comprise the default course dotfiles. You should take some time to look in them, and see what they are actually setting up (remember, they are going to be found in one of the directories that was specified in the use lines).


next up previous
Next: Personal Environment Settings Up: The Modules System Previous: How to Use the
Seth Proctor
1998-09-08