zsh-users
 help / color / mirror / code / Atom feed
From: "Павлов Николай Александрович" <kp-pav@yandex.ru>
To: Ray Andrews <rayandrews@eastlink.ca>,zsh-users@zsh.org
Subject: Re: export
Date: Wed, 26 Nov 2014 08:50:44 +0300	[thread overview]
Message-ID: <70F0141D-33D9-4398-815B-22EA5BEA3E83@yandex.ru> (raw)
In-Reply-To: <54756007.6060800@eastlink.ca>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On November 26, 2014 8:07:19 AM EAT, Ray Andrews <rayandrews@eastlink.ca> wrote:
>On 11/25/2014 08:32 PM, Bart Schaefer wrote:
>> On Nov 25,  4:57pm, Ray Andrews wrote:
>> } Subject: export
>> }
>> } When I export a variable it is only available in subsequent shells
>in
>> } the same xterm. Can I make it export globally?
>>
>
>You guys don't understand what I'm asking.  I know I can't pass
>variables 'backwards' (except via a file), but when I export, the
>variable will be available  in *subsequent* shells but only in the
>same xterm:
>
>	pts/2 HP-y5--5-Debian1 root /aWorking/Zsh $ export trash=TRASH
>
>	pts/2 HP-y5--5-Debian1 root /aWorking/Zsh $ zsh
>
>	pts/2 HP-y5--5-Debian1 root /aWorking/Zsh $ echo $trash
>	TRASH
>
>... export does what it should do, but *only* in the same xterm.
>If I now go to another xterm, $trash is not set:
>
>	pts/9 HP-y5--5-Debian1 root /boot/Clone/y8--5-Debian2 $ zsh
>
>	pts/9 HP-y5--5-Debian1 root /boot/Clone/y8--5-Debian2 $ echo $trash

In another xterm there is different zsh process. Environment for the new shells is inherited from the parent. It absolutely irrelevant which existing process you may want to modify environment in. The only thing that was added is that with this requirements you may take this environment once at startup (e.g. in $HOME/.zshenv) and not in some hook like precmd.

And it does not do what it does "in xterm". It only does thing for the current shell process and next process run from the shell only inherits the environment. Given the existence of screen and dtach (not tmux: here environment is inherited from the server) you may migrate shells between terminal emulators. Or start screen in one and attach in its neighbour: after some scripting this may be a solution. Tmux may also be a solution: if you export in your shell and then repeat "export" using "tmux set-environment -g" then exported variable will appear in all new tmux instances.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQJNBAEBCgA3BQJUdWoyMBwfMDI7PjIgHTg6PjswOSAQOzU6QTA9NEA+MjhHIDxr
cC1wYXZAeWFuZGV4LnJ1PgAKCRBu+P2/AXZZIns4EADOYIUvpa4jnzqL3EKkEw5A
nqOk2l8ytAgiK9Y4Nxd/9NTJMJ41H4sFJO/0bE3RARhx5eeVcItLgFnLaRKm5AyR
ghDeiRJgehcrph+gQFqKROWJ4jLFG62HuWDXlkqWuVcpLZHf9JE//nMQFl3RLjc1
gW4szARFQUhGb4E0bQhg7T+wZzA2KF1tb8Nhj1pt23/LvyZzot3Hnj5TQvvogZ2d
Ajajk42e/Z8rRvwuZDc8u1uiSwwhM9NoFXbaQEUDO+ddpS4CQW1cyxeYa9u7y2S5
jzV09STtQb4V6hBhPKS5JqZiCGYwjS4k/yGvWPnyck6WIw6UhPuPMhmHjw1AGYOt
tPrzMu3h6H2XAPVh6HvtPhkqvPTvUO9g3B6aJDYjXh1YvDMnPjOIgUL/naSyML5E
qCzoP9oOtaeqkyxkLidBKnrxW2/1/ExwjAg9gj7244zOxXRDd+L4o3S6bG+4Z1iR
w+T4fltR0v7e3Ad3lbM0nERl8UaWhbQMhvIL7d8WCA/dSbdxuee3dATYk+y/Ucaw
uLItZXiyPj2jBowoOuNONkjOqgqaUI18Uu7QTMaUBBs4fXiIPbJziqh5W8/P629A
CZwME1Cwq8tgPn1ggsnkG6o4X27u1w9WqBSmarAGh5tBb+CGXdGtl/D/DwerJDsb
omg7NC9P5XLcLXmSGL9uRw==
=+xrg
-----END PGP SIGNATURE-----


  parent reply	other threads:[~2014-11-26  5:56 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 ` export Kurtis Rader
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     ` Павлов Николай Александрович [this message]
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=70F0141D-33D9-4398-815B-22EA5BEA3E83@yandex.ru \
    --to=kp-pav@yandex.ru \
    --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).