Re: Where is $MAIL set? (login process)
On 3 Jun 2003 Bill Moseley <email@example.com> wrote:
>> - environment variables have to be set only once and are inherited by all
>> processes that are children of the login shell or the X session,
>> but things like aliases and shell options have to be set every time
>> a shell is started.
> Good to know. (I'm still not clear about variables shown with "set", but
> I'm sure that's just a google away...)
To save you a google (maybe quite some, because this is a simple question,
and *clear* answers to simple questions are sometimes hard to find by
'googling'): I believe that
shows you the *environment* of your current shell, while
shows you *all the variables* of your current shell.
The environment contains all shell variables that were made into environment
$ export VARIABLENAME
In addition to environment variables you may have other shell variables that
where not 'exported'.
The significant difference between environment variables and ordinary
variables is that the former will be available to child processes,
the latter not.
You can easily find out whether my belief is correct by setting some shell
variables, compare the output of printenv and set, then export those same
shell variables and repeating the comparison.
Anjelierstraat 1, 2014 TC Haarlem, Netherlands
tel +31 23 5324909, firstname.lastname@example.org