title: Write a record count to a variable in unix shell script
body: <p>I'm a newbie to Shell script requirement is need to get  row count from a flat(.txt) file and assign to a int variable.</p>
  
  <p>Trying this but not working</p>
  
  <pre><code>FNAME="pn_data_"$month$day$year".txt"
     declare -i recordcount=0
        for f in $FNAME
       do
         recordcount+=`wc $f |'{print $1}'`
       done
  </code></pre>
  
  <p>Any suggestions around would be appreciated.</p>