title: Variable is not changing from subshell
body: <p>There is a simple code to demonstrate the problem:</p>
  
  <pre><code>[kan@altegom ~]$ ( A=1; ls | if true; then A=2; fi; echo $A; )
  1
  </code></pre>
  
  <p>I expect output <code>2</code>, but because the <code>if</code> is executed in pipe (I think it instantiates a new shell), the variable assignment is not visible.</p>
  
  <p>How could I change a variable from a pipe?</p>