[wplug] Managing Environment Variables

Jonathan Billings billings at negate.org
Mon Nov 23 21:20:37 EST 2009


On Mon, Nov 23, 2009 at 03:11:53PM -0500, Weber, Lawrence A wrote:
> I tried sourcing (.) bash scripts that export new values but found that
> did not work.  It appears as if some sub shells created during the build
> are grabbing the environment variables' value that .bashrc set when the
> terminal shell opened.  

Why don't you leave the environment variables out of your bashrc, put
them into individual files, and source them when you want to use a
particular build environment?  All the child shells will inherit the
exported environment variables.

There's actually a tool we use in HPC environments to help automate
this kind of behavior, called Environment Modules
<http://modules.sourceforge.net/>.


-- 
Jonathan Billings <billings at negate.org>


More information about the wplug mailing list