Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: export



It's a function of the operating system. All UNIX like operating systems
use an inheritance model. That is, when a new process is spawned it gets a
copy of the parent environment or one specially crafted by the parent for
the child process. The environment is copied into the address space of the
process (almost always near the top of the stack before the main() function
is invoked). This means each process has its own, private, set of
environment variables. This makes it infeasible for one process to modify
the environment variables of another process.  It also means, obviously,
there is no "global" set of environment variables. This book is the best
one for understanding why things work the way they do on UNIX like
operating systems: http://www.apuebook.com/apue3e.html

Try typing "man execle" at a shell prompt to read about the API that zsh
uses to start a new process and pass it an environment. That command may or
may not work depending on the packages you've installed on your system.

I've programmed on at least two operating systems which had a totally
different model for the equivalent of environment variables where what
you're trying to do was possible. But those operating systems were swept
into the dustbin of history several decades ago.

On Tue, Nov 25, 2014 at 4:57 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:

> When I export a variable it is only available in subsequent shells in the
> same xterm. Can I make it export globally?  Or is the issue somehow related
> to the xterm itself?
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank


Messages sorted by: Reverse Date, Date, Thread, Author