[lug] modifying environment variables on the fly

Hugh Brown hugh at vecna.com
Tue Apr 17 10:32:20 MDT 2001

This is what we decided to do.  All of the projects are in CVS so we added
a file named EnvironmentSetup.bash in each projects directory, then we set
a global alias (alias sp=". ./EnvironmentSetup.bash") and then people just
type sp (switch project) after they enter the appropriate directory.



"rm at mamma.varadinet.de"
> On Tue, Apr 17, 2001 at 11:07:48AM -0400, Hugh Brown wrote:
> > I am supporting a bunch of java developers that are working on several
> > projects and have to change CLASSPATH each time they switch to a different
> > project.  Is there a slick way to do this without doing export
> > CLASSPATH="blah:blah:blah...." before they begin working on a new project?
> How would you want this to happen? To be effective in all programs
> executed you need to change this in the invoking shell. Since called
> programs _can't_ modify the environment of the caller you need to
> tell the calling shell about the changes in the environment (which
> is done either by calling 'export ...' or sourcing a file with the
> '.' command. When i did Java i had a set of files in my home directory
> that contained the neccessary calls to 'export ...'. Whenever i switched
> settings i would issue ' . ~/jdk1.3-env ' and everything worked ok).
> Another solution might be to write your own custom wrapper arround
> java/javac/javap etc. that sets CLASSPATH and friends accoding to
> custom settings (for example by sourcing a .jenv file in the current
> directory).
>  Ralf
>  (Interested in better solutions)
> > Hugh
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

More information about the LUG mailing list