Closed xPMo closed 4 years ago
Another one.
I think the source of the problem is that Zsh behaves like Bash shopt -s lastpipe by default, where the last command list in a pipeline is executed in the current environment:
shopt -s lastpipe
echo ${var1=set} | read var2 echo ${var1-unset} ${var2-unset}
In Zsh, this prints unset set, but in Bash, this prints unset unset.
unset set
unset unset
Another one.
I think the source of the problem is that Zsh behaves like Bash
shopt -s lastpipe
by default, where the last command list in a pipeline is executed in the current environment:In Zsh, this prints
unset set
, but in Bash, this printsunset unset
.