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

Re: print builtin preceded by parameter assignment



On Wed, 2019-04-10 at 16:11 +0200, Vincent Lefevre wrote:
> 1. If the command name is not a special built-in utility or function,
> the variable assignments shall be exported for the execution environment
> of the command [...]
> 
> In this case, the variable assignments should affect the output.

I see how you're interpreting this --- the "execution environment of the
command" is anything the command happens to do, not just what the
environment itself would show, while "the current execution
environment", which explicitly isn't affected by a bit you didn't quote
and which I assumed included "print" as it is part of the current
execution environment, to you is just what happens after the command
finishes.

In any case, I wasn't planning on changing this --- effectively adding a
full local variable behaviour when the intention of the syntax is to
export a parameter to the environment is a bit perverse.  If anyone else
thinks they can do it without major grief they're welcome to have a go
and we can see if the end justifies the means.  Often (but by no means
necessarily) this sort of thing breaks more than it fixes.

pws



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