Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2007 17:03:06 -0500
From:      Tim Daneliuk <tundra@tundraware.com>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: [stupid question] setting env variables globally
Message-ID:  <4719299A.8050103@tundraware.com>
In-Reply-To: <20071019211433.GA76124@owl.midgard.homeip.net>
References:  <4718D7D4.2010604@gmail.com> <20071019211433.GA76124@owl.midgard.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Fri, Oct 19, 2007 at 04:14:12PM +0000, Aryeh M. Friedman wrote:
>> Is there any way to set the default value of a enviromental variable
>> globally.   Specifically I want JAVA_VERSION to default to "1.6" unless
>> the user sets it other wise.   By global I mean no matter how something
>> is invoked (command line, script, GUI, IPC trigger, etc.) if it checks
>> the value of the var it gets the same value (and I want to do this
>> system wide)
> 

For userland stuff that is invoked after a login (i.e. In some user's
login context), I have a master profile I keep in /usr/local/etc/.myprofile.
I then source this from the .profile or .bashrc  in a given user's account.

If you need this for cron jobs, there is a way to set environment variables
in the crontab entry IIRC...

HTH,

----------------------------------------------------------------------------
Tim Daneliuk     tundra@tundraware.com
PGP Key:         http://www.tundraware.com/PGP/





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4719299A.8050103>