in reply to How can I grab the last 2 lines of a file?
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`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I grab the last 2 lines of a file?
by muba (Priest) on Jul 26, 2014 at 23:19 UTC | |
by Anonymous Monk on Sep 20, 2014 at 12:28 UTC | |
by LanX (Saint) on Sep 20, 2014 at 13:53 UTC |