title: Is it possible to set variable in pipeline?
body: <p>I have a big txt file which I want to edit in pipeline. But on same place in pipeline I want to set number of lines in variable $nol. I just want to see sintax how could I set variable in pipeline like:</p>
  
  <pre><code>  cat ${!#} | tr ' ' '\n'| grep . ; $nol=wc -l | sort | uniq -c ...
  </code></pre>
  
  <p>That after second pipe is very wrong, but how can I do it in bash?</p>
  
  <p>One of solutions is:</p>
  
  <pre><code>nol=$(cat ${!#} | tr ' ' '\n'| grep . | wc -l)
  pipeline all from the start again
  </code></pre>
  
  <p>but I don't want to do script the same thing twice, bec I have more pipes then here.</p>
  
  <p>I musn't use awk or sed...</p>