MCS SoftEnv FAQ


SoftEnv is the system used at MCS to help build a user's UNIX-based
software environment.  SoftEnv reads the .soft file and then sets up
the user's PATH, MANPATH and so on.


General Questions
  1. What is the purpose of SoftEnv, and how does it relate to .software?
  2. What do I put in my .soft file?
  3. How do I convert my old .software (or .software-beta) file to the new .soft system?
  4. What keys can be used in ~/.soft?
  5. Are SoftEnv keys case sensitive?
  6. What if I want to use a keyword only once?
  7. How do you change your enviroment with SoftEnv on the fly?
  8. How can I find out what is included in the default?
  9. Can a key be added to all users in a group? (globus, adm, fl, etc)
  10. Where do I find more information?
  11. Are you releasing this software to the public?
  12. What if I really hate all these .soft files, and want to define my environment using only my .cshrc file?
  13. How do I have my cron jobs use my .soft?
Syntax Questions
  1. What is the syntax of a ~/.soft?
  2. Can I see an example ~/.soft file?
  3. If I have a choice, should I declare a version number?
  4. What if there is something defined in @default that I don't want to
    use but I still want to include everything else from @default?
  5. How do I use a different version of a program that the one included in default?
  6. How do I add information to my PATH or MANPATH?
  7. What's the difference between the "=" and "+=" operators?
  8. How do I add to my PATH only when I'm on foo?
  9. How do I escape charaters, like "+", when declaring a variable?
  10. How do I use IF (conditional) statements in my .soft file?
  11. What are valid ARCH values?

Trouble Shooting Questions
  1. My environment is broken, I can't even run 'rm', what do I do??
  2. There is a problem using application foo. What should I do?
  3. On login, I get a message that says my software environment is
    being updated
    . What is happening?
  4. I use .soft, and on login, I get a warning about my .software or .software-beta files. I want to get rid of it.
  5. It says there are unrecognized words in my .soft file. What do i do?

General Questions


What is the purpose of SoftEnv, and how does it relate to .software?

SoftEnv is a software abstraction system. It allows users to specify applications they want to use in a configuration file, and then their environment is setup correctly on every UNIX system in our computing environment. . Users don't have to track application changes (like new environment variables or changed paths) or worry about new applications unless they want to.

The .soft file is used on every UNIX computer in MCS to set 3 basic things in your shell's environment:

(Before March 2000, this functionality was handled by a file called .software.)  On a conventional UNIX system, you are responsible for setting these up yourself.   However, at MCS, the recommended values for these variables changes rather frequently.  So, rather than your having to try to keep up with all of the recommendations and special changes and then update your files yourself, we put the values in a database, and the .software system automatically looks them up for you. 

For example, if your PATH needs to be updated for you to be able to access some newly-installed piece of software, then the .soft system will change your PATH automatically the next time you login.   The way to customize your environment is explained in this FAQ.


^ Back to Questions ^

What do I put in my .soft file?

In general, we recommend just putting this line in to start with:

@default

This will add all of the system paths, tons of applications, and local customizations to your environment. 

As your needs grow over time, you can add specific applications that might not be part of the default environment (the vast majority are in the default though), or your own environment variables, or special conditional statements.  All of these are described later in this page in the Syntax section.


^ Back to Questions ^

What keys can be used in the ~/.soft file?

The command 'softenv' displays every key that exists on the new system.  Probably more than you want to see, in fact.  Read the man page for softenv for more information.

Two other useful features to know are:


^ Back to Questions ^

Are SoftEnv keys case sensitive?

YES! Contrary to the previous .software system,  'softenv' does care about the case of words.  Therefore, +idl is not the same as +IDL, also notice these

return different keys.


^ Back to Questions ^

What if I want to use a keyword only once?
How do you change your enviroment with SoftEnv on the fly?

With 'soft add <keyword>', you can at that moment, add that keyword to your environment. Similarly, with 'soft delete <keyword>', you can delete any instances of that keyword from your environment. It is also suggested that you run 'resoft' whenever you want to be sure your environment is back to normal.

For example, if you want to try out idl, do the following:

> soft add +idl
> idl &
(do whatever you want)
> soft delete +idl

Or, you can create two .soft files. If you create a .soft.idl file containing:

+idl
@default

then you  execute the command 'resoft .soft.idl'.  You will then get the environment based on that file. A plain old 'resoft' will set you back to your real environment.


^ Back to Questions ^

Can a key be added to all users in a group? (globus, adm, fl, etc)

We recognize this is helpful for many groups; however, you can't change it yourself. Send an email to systems and we will usually agree with your plan and set up the key.


^ Back to Questions ^

Where do I find more information?

At any UNIX prompt, type

There are other administrative man pages which systems can point you to.


^ Back to Questions ^

Are you releasing this software to the public?

Yes, this software will be open-source and released as part of Msys, the MCS Systems Administration Toolkit. The coding was done by Remy Evard (evard@mcs.anl.gov) and Alan Bailey (bailey@mcs.anl.gov).


^ Back to Questions ^

How can I find out what is included in the default?

Run the command 'softenv'. If there is a '*' on the left side of a keyword, that tells you that this keyword or macro is included in the definition of @default.


^ Back to Questions ^

What if I really hate all these .soft files, and want to define my environment using only my .cshrc file?

Create a file called .nosoft in your home directory. This will disable all parsing of .software, .software-beta, and .soft files.

May the force be with you. :)


^ Back to Questions ^

How do I have my cron jobs use my .soft?

The SoftEnv system creates sh and csh scripts in your home directory that are loaded by the shell to build your environment. Cron jobs don't do this automatically, but you can arrange for them to do so by loading them directly.

If your cron job is an SH script, do this near the beginning: . $HOME/.soft.cache.sh

If it's a csh script, do this: source $HOME/.soft.cache.csh

Note that if your cron job is just a simple command in your crontab then this won't work... the command needs to be invoked from a script that first does one of the above calls, and then calls the command.


^ Back to Questions ^


Syntax Questions


What is the syntax of a SoftEnv file (~/.soft)?

The .software file is a basic text file. Lines starting with a # are considered to be comments and are ignored.  Blank lines are fine too.  Note:

Each line in the .soft will look like one of these:

@{macro}
+{key}
PATH+=/foo
MANPATH+=/foo/foo
CVSROOT=/home/foo/foo
if ARCH=solaris-2 then PATH+=/foo
if ARCH=sun4 then @sun4-legacy-apps
if HOSTNAME=gaea then +gcc-2.3.1
@remove {key} {macro}

An example ~/.soft file would be:

.soft file What this entry means

+absoft If you run 'softenv -k absoft', you will see that absoft is not included in the default settings for SoftEnv.  This line adds to your environment all the settings necessary to use the program absoft.
+acroread-3.1 Add to my environment all the settings necessary to use the program acroread-3.1.  If you run 'softenv -k acroread -a solaris-2', you will see that this application no longer exists on solaris-2.
+idl Add to my environment all the settings necessary to use the program idl.  If you run 'softenv -k idl', you will see you can either specify you want idl-5.2 or you can specify idl without a version number.  You should generally chose to use the key without a version number, so that you are always equipped with the default stable version.  Only if you want to use an application that is not the default should you use a key like +idl-5.2.
+jdk-1.1.6 Add to my environment all the settings necessary to use the program jdk version 1.6.  If you run 'softenv -k jdk', you will see that you can chose between versions 1.2, 1.1.5, or 1.1.6.  In this case, you must specify the version number because there is no default version.
@remove +totalview
+totalview-beta
(This is for advanced users only.)  If you put @remove <keyword> on the top of your .soft file, it will remove any instances of that keyword from any future macros you use in your .soft file.   NOTE:   This means "@remove"s have to come before @default to override the default settings.

For this example, if you run 'softenv -k totalview', you will see that "the default stable version of totalview" is part of the default SoftEnv settings.  However, if you would rather use the beta version of totalview, and not the stable version, you can.  First you must remove the stable version from your environment; then add the key for the beta version.

@default This line adds all the default information to your environment.  For a lot of users, this is the only line necessary in the .soft file.   If you run 'softenv -k program' and see a * in the far left column, this key is part of the default.  For example, the keyword '+mh' is included in @default. Thus, you don't need to specifically add that key (+mh) to your .soft file.
PATH+=/home/tdgl/bin
PATH+=/home/tdgl/docs/psfig
Add the two paths specified to my PATH environment variable.   Note the operator is "+=".  If you were to use "=", you would remove all previous or default information from the PATH variable.
DPSSHOME=/home/username/DPSS
DPSSHOST=dpss.lbl.gov
Set the environment variable DPSSHOME and DPSSHOST as specified.  Note that the operator used is "=" and not "+=".   This means that if there was any default settings for these variables, you would overwrite them with your settings.  You have effectively set the variables to the values specified, instead of adding information to the default.
IDL_PATH+="+/home/username/IDL:+/home/tdgl/IDL" In this case, the information you wish to add to the IDL_PATH contains a + sign.  To ensure the + is added to the path and not confused with the "+=" operator, surrounded the value in double-quotes.  (Otherwise, the assignment wouldl produce an error.)  Any time there is an uncertainity in parsing a value, surrond it in quotes.
if ARCH=linux then PATH+=/home/username/bin If I am on a Linux machine, then add /home/username/bin to my path.
if ARCH=solaris-2 then PATH+=/home/username/solaris-2/bin If I am on a Solaris-2 machine, then add /home/username/solaris-2/bin to my path.

^ Back to Questions ^

How do I use IF (conditional) statements in my .soft file?

Conditionals are very versatile now, and are a totally different syntax as compared to the old syntax. Use them like:

if ARCH=linux then +idl

You can use any variable in the conditional; however, only

are provided. You can also include anything after the 'then' in the statement, such as PATH sets, keyword additions, or macro additions.

You can additionally create any other variables you might want. Some examples:

FOO="`whatami`"
if FOO=sun4 then +adm

MYVAR="`/homes/username/bin/usedefault`"
if MYVAR="yes" then @default

if HOSTNAME=fire then PATH+=/homes/username/bin/fire

^ Back to Questions ^

What are valid ARCH values?

You can use anything from the output of 'whatami -l'.  However,  at this moment (Feb 2000), only five of those will do anything:

(Notice also that these are different than the architecture strings used with .software or .software-beta.)


^ Back to Questions ^


Trouble Shooting Questions


My environment is broken. I can't even run 'rm', what do I do??

Type resoft, which will almost always give you a working environment. Then create a .soft file with @default in it, and log out and log back in. This
will create a clean environment from your .soft file.


^ Back to Questions ^

There is a problem using application foo. What should I do?

First, check your .soft file to make sure it is sane.

If all else fails, send email to systems, and we'll see what the problem is.


^ Back to Questions ^

On login, I get a message that says my software environment is being updated. What is happening?

That either means you updated your .soft file recently, or an administrator made a change to the database.

To find out what changes an administrator made, view this webpage containing information from the rcs updates to the database.


^ Back to Questions ^

I use .soft, and on login, I get a warning about my .software or .software-beta files. I want to get rid of it.

Assuming your environment is set up how you want it, you can remove your .software or .software-beta files from your home directory,
either by deleting them or renaming them.


^ Back to Questions ^

It says there are unrecognized words in my .soft file. What do i do?

View the file ~/.soft.cache.csh. The errors that occured listed near the top of that file. Then you can edit your .soft file to fix the errors.


^ Back to Questions ^


[ FAQs | Account Request | Equipment Checkout | Announcements | Tech Updates | Systems ]
Last updated on July 28, 2000
systems@mcs.anl.gov
webmaster@mcs.anl.gov