On 5/12/05, Andreas Kahari <[EMAIL PROTECTED]> wrote:
> These are variables typically used by processed started from the shell
> session.  Without exporting the variables, they would not be seen by
> new processes.
>
That's true---but login(1) already exports them (see below, or man 1 login).

> The fact that you don't see a difference when you remove that line
> (from your own ~/.profile I presume) is probably an indication of that
> you either export them elsewhere within the session, or that you did
> not know what this meant or how to test it.
>
I understand exporting environment variables or not;  try the
following:  use the skel .profile as your ~/.profile.  Comment out the
export line.  Add a new line:  sh ~/test-export .  Finally, add the
below script:
~/test-export:
#!/bin/sh

echo PATH=$PATH
echo HOME=$HOME
echo TERM=$TERM

You'll see that any changes (such as the PATH) which take place in
~/.profile are properly propagated into the environment, because the
variables have already been placed there by login(1).  (This can be
tested manually after logging in, as well.)

> I do not believe that login(1) actually does anything more than just
> sets the variables, e.g. it does not export them.
>
>From man 1 login:
     login enters information into the environment (see environ(7)) specifying
     the user's home directory (HOME), command interpreter (SHELL), search
     path (PATH), terminal type (TERM), and user name (both LOGNAME and USER).

--
Christian Jones
[EMAIL PROTECTED]
http://www.aleph0.com/~chjones

Reply via email to