Larry,
    As I understand this process, you are a little off. When you export a
variable it is available for that shell and for all sub-shells. This does not
mean that all of root's env varbs will be available in everybody's shell. What
this means is that if I launch a shell and type the following:

export MYVARB=cool_tools
xterm &

Both the original shell and the new shell will have the MYVARB variable set.
If you are looking to set a variable for all users then you would want to add
this to the "global" environment file (bashrc, cshrc, profile, login,
csh.login, whatever). This should be called by all users when the launch their
shell. The problem starts when you have several users using different shells.

I hope this helps. I cannot say that this is all correct, as I have figured
this out by trial and error.

Garl

larry a price wrote:

> hi all, i've got a question for the gurus,
>
> what really happens with environment variables, and how are they visible?
>
> when you say something like
>
> APP_LOG_DIR=/var/log/app/error.log
> export APP_LOG_DIR
>
> that sets the the environment variable for the rest of the current session
> and for all sessions spawned by that session, right?
>
> so if those statements are in a script executed by root at startup that
> variable should be set for all user sessions, right?
>
> but it doesn't seem to be happening that way, so where am i confused?
>
> also what does the
>
> . /etc/path/to/script
>
> idiom do, it doesn't seem to be documented in the place i expect it to be
> but i see it used in a number of scripts in /etc/postgresql
>
> can someone point me to a clear and lucid explanation of what's going on,
> i've read the man pages but they are rather opaque...and i'm still not
> getting what i expect from the beast.
> -thanx
>
> Larry Price      |  "We have seen the truth.
> [EMAIL PROTECTED]  |   And the truth makes no sense." -chesterton
> _______________________________________________________________

--
=============================================================================
Garl R. Grigsby
Senior Customer Applications Engineering - Analysis Team
-----------------------------------------------------------------------------
Structural Dynamics Research Corporation      Phone: (800)242-7372
TAO Americas Support Center                   FAX: (541)342-8277
1750 Willow Creek Circle                      Email:  [EMAIL PROTECTED]
Eugene, OR 97402                              Internet:  http://www.sdrc.com
=============================================================================
-FEA makes a good engineer great, and a poor engineer dangerous-
=============================================================================

Reply via email to