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

Re: Strange behavior of $jobstates



On Wed, 2018-11-14 at 10:43 +0900, Manabu Matsui wrote:
> As a result of this change, the operation of the parameter expansion
> having a side effect also has changed. Is this intended?
> 
> Before this change (zsh 5.4.2 (x86_64-ubuntu-linux-gnu)):
> % a=1
> % echo ${a::=2}|cat
> 2
> % echo $a
> 2
> 
> After this change (zsh 5.6.2 (x86_64-apple-darwin18.0.0)):
> % a=1
> % echo ${a::=2}|cat
> 2
> % echo $a
> 1

Yes, the change is correct.  Setting a parameter in the left hand side
of the pipeline shouild not affect anything outside the pipeline.

Although the standard doesn't specify which side of the pipeline is run
in a forked copy, in zsh it's always the left hand side, so the fact
that effects were escaping from there was a bug.

pws



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