Looking for zsh Answers? Try Ask4KnowledgeBase
Looking for zsh Keywords? Try Ask4Keywords

zsh Pipes and subshells


Example

In bash, every command in a pipeline is executed in a subshell. In zsh, the last command in a pipeline is executed in current shell. For example, the following code

var="before"
echo "after" | read var
echo $var

will print before in bash, but after in zsh.