Normally, I'd suggest a pure Perl solution, such as the one AppleFritter suggested but in this case I'll suggest a mixed perl/shell solution that needs only 1 line of code.
my ($id, $name) = split {$/}, `tail -2 /path/to/file`;In reply to Re: How can I grab the last 2 lines of a file?
by fishmonger
in thread How can I grab the last 2 lines of a file?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |