in reply to how can i read only the last line of a files

In addition - see eof
eof # this is the last line and print while <$fh>