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

Re: "VAR=foo export VAR" no longer works in zsh emulation



On Tue, 24 Jan 2017, Peter Stephenson wrote:

> It looks up to 5.2 you don't need the option, and this changed in the
> commit below.
>
> So it's less sh compatibility, as it still works there, and more
> backward compatilibity in zsh.
>
> pws
>
> commit c8de0af35935602370cc79193d0e0d53971250d4
> Author: Barton E. Schaefer <schaefer@xxxxxxx>
> Date:   Mon Sep 19 00:25:13 2016 -0700
>
>     39381: handle save/restore of variable values when "typeset"-related reserved words are prefixed by an assignment


Hrm, this is a bit ugly.

It might be possible to fix this for "export" by a special-case on the
command name, but it's going to be nearly impossible to make "typeset -x"
behave equivalently, because the save/restore is generic in exec.c where
we barely know what command we're about to run, and we don't learn that
we're exporting until the depths of bin_typeset(), nor propagate that
back out in any way.



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