program to print last N lines from a file