Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: export
- X-seq: zsh-users 19441
- From: Павлов Николай Александрович <kp-pav@xxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>,zsh-users@xxxxxxx
- Subject: Re: export
- Date: Wed, 26 Nov 2014 08:50:44 +0300
- Authentication-results: smtp17.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1416981055; bh=l7dXRiYHdY9OvrkW+tgeRwzp15M1Sfq+GelwsaoLtm0=; h=User-Agent:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type:Subject:From:Date:To: Message-ID; b=Sa7XK8pV2DvZmfYKvgZ5jHvEfVNYnR17APbl4esEY7DXIeGOYh4SR854h2m7eNl/+ xwnhJpRwLZMEE1+cMrsx6HV9HqleW1sP3Kh5IWz2BoA+AK5QhGaoDD/+5y0XbZWkPj eBwFP/NFr2ViWWUH3m/MTBx8M39Hf3y9mQL7ouAc=
- In-reply-to: <54756007.6060800@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <54752574.5090205@eastlink.ca> <141125203249.ZM18877@torch.brasslantern.com> <54756007.6060800@eastlink.ca>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On November 26, 2014 8:07:19 AM EAT, Ray Andrews <rayandrews@xxxxxxxxxxx> 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-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author