awk 'END{ print "this is the last line : ", $0, " | and NR is -> " NR, "do something else here..." }' myfile.txt
lastRec=`awk 'END{print NR}' myfile.txt` awk -v aLastRec="$lastRec" '{if (NR == aLastRec) ... }' myfile.txt