zsh-users
 help / color / mirror / code / Atom feed
From: Kurtis Rader <krader@skepticism.us>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: export
Date: Tue, 25 Nov 2014 18:58:40 -0800	[thread overview]
Message-ID: <CABx2=D-d6_d6Rqi3xh4MPH-ruorbnFmWAwf2xBnfCfQzn6fscw@mail.gmail.com> (raw)
In-Reply-To: <54752574.5090205@eastlink.ca>

[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]

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@eastlink.ca> 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

  parent reply	other threads:[~2014-11-26  2:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  0:57 export Ray Andrews
2014-11-26  2:36 ` export Eric Cook
2014-11-26  2:58 ` Kurtis Rader [this message]
2014-11-26  4:32 ` export Bart Schaefer
2014-11-26  4:54   ` export Kurtis Rader
2014-11-26  5:16     ` export Ray Andrews
2014-11-26  5:38       ` export Kurtis Rader
2014-11-26  5:07   ` export Ray Andrews
2014-11-26  5:43     ` export Kurtis Rader
2014-11-26  5:54       ` export Kurtis Rader
2014-11-26 17:43       ` export Ray Andrews
2014-11-26 18:26         ` export Павлов Николай Александрович
2014-11-26 18:45           ` export Ray Andrews
2014-11-26  5:50     ` export Павлов Николай Александрович
2014-11-26  6:21     ` export Kurtis Rader
     [not found]   ` <CABx2=D_zLTkdFsV+eT-VrwwaJQYr=1JeZF0eNqH44saPDYMD7Q__49907.9755544246$1416977797$gmane$org@mail.gmail.com>
2014-11-26  7:18     ` export Stephane Chazelas
2014-11-26 13:37       ` export Clint Hepner
2014-11-26  9:27 ` export Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABx2=D-d6_d6Rqi3xh4MPH-ruorbnFmWAwf2xBnfCfQzn6fscw@mail.gmail.com' \
    --to=krader@skepticism.us \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).