title: How to use the pipe in a file with head-tail operation?
body: <pre><code>    size=$(wc -l &lt; "$1")
      if [ "$size" -gt 0 ]
      then
          tr "[:lower:]" "[:upper:]" &lt; $1  &gt; output
          for (( i=1; i &lt;= "$size"; ++i ))
          do
              echo "Line " $i $(head -"$i" &gt; output | tail -1 &gt; output)
          done
  </code></pre>
  
  <p>Hi, guys!
  I have a problem with this little code. Everything works fine except the head-tail thing. What I wanna do is just displaying the line number "i" from a file.
  The results that I receive are just the last line ($size).</p>
  
  <p>I think maybe it is something wrong with the input of tail. The head -"$i" doesn't go at the specified line. :(
  Any thoughts?</p>
  
  <p>Ohhhh... I just realised: As input for my tail i give the same input for head.
  The solution is to give to tail the result from head. How do I do that? :-/</p>