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

Re: PATCH: 3.1.5: eval with exported vars

"Andrej Borsenkow" wrote:
> But as I understand, your patch blindly exports variable for every builtin?

No, just eval, which is a peculiar case because you really don't know
what it's going to do.  The workaround I gave (assignment after the
eval) is really the best way of doing it.  You can certainly argue
it's not right to have eval as a special case, but I'd say exporting
it rather than just setting it is the safest here.

> bor@itsrm2:/tools/var%> FOO=x eval sh -c '"echo $FOO"'
> x
> bor@itsrm2:/tools/var%> echo $FOO
> Still wrong - FOO disappears.

This is supposed to depend on the setting of POSIXBUILTINS.  It does
seem to work for me.  It's annoying there's yet another option, but I
think it's mainly for setting for for ksh emulation rather than `real'
zsh users.

Possibly the patch I sent should have a !isset(POSIXBUILTINS) wrapper?

Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy

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