title: awk assign field string to variable not working
body: <p>Just wondering why this is not working? </p>
  
  <p>this is my awk code, converting "hh:mm:ss" format to seconds</p>
  
  <pre><code>  a.awk 
    3 BEGIN {                                                                         
    4     FS=":";                                                                     
    5 }                                                                               
    6                                                                                 
    7 {                                                                               
    8     retval = 0;                                                                 
    9     for (i = 1; i &lt;= NF; i++) {                                                 
   10         retval += $i * 60 ** (NF-i);                                            
   11     }                                                                           
   12     print $retval;                                                                
   13 }                                                                               
   14                                                              
  
   input.txt
   59:22:40
  
   $ cat input.txt  | awk -f a.awk 
      //&lt;empty&gt;
   $
  </code></pre>
  
  <p>however, I try it on command line: </p>
  
  <pre><code> $ echo "00:59:30" | awk 'BEGIN { FS=":" } { retval = 0; for (i = 1; i &lt;= NF; i++) {  retval += $i * 60 ** (NF-i); } print retval;}'                 
   3570
  </code></pre>
  
  <p>what's wrong with a.awk ? </p>
  
  <hr>
  
  <p>update just for clarifcation</p>
  
  <pre><code>$ awk --version
  GNU Awk 4.0.1
  Copyright (C) 1989, 1991-2012 Free Software Foundation.
  </code></pre>