title: Read content of file line by line in unix using 'line'
body: <p>I have a file - abc, which has the below content -  </p>
  
  <pre><code>Bob 23  
  Jack 44  
  Rahul 36 
  </code></pre>
  
  <p>I also have a shell script that do the addition of all the numbers here.
  The specific line that picks up these numbers is -  </p>
  
  <pre><code>while read line  
  do  
      num=echo ${line#* }  
      sum=`expr $sum + $num`  
      count=`expr $count + 1`  
  done&lt; "$readfile"  
  </code></pre>
  
  <p>I assumed that the code is just picking up the last field from file, but it's not. If i modify the file like   </p>
  
  <pre><code>Bob 23 12  
  Jack 44 23  
  Rahul 36 34 
  </code></pre>
  
  <p>The same script fails with syntax error.</p>
  
  <p>NOTE: I know there are other ways to pick up the field value, but i would like to know how this works.</p>