Re: Read 20 lines when pressing n for next
- From: Ted Zlatanov <tzz@xxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 13:15:47 -0500
On Tue, 29 Apr 2008 18:21:12 -0700 (PDT) s9uzaa@xxxxxxxxx wrote:
s> I would like to write a perl script with the following criteria match.
s> 1. open any text file taken the name from the command line.
s> 2. read top 20 lines and stops, then
s> 3. ask to press letter "n or p" (for next/previous) to print next or
s> previous 20 lines.
s> would appreciate any kind of help.
s> 4. must have subroutine used.
perl -e'sub { exec less => -20 => @_}->(@ARGV)' FILE1 FILE2 ...
Unfortunately this uses SPACE or `f' instead of `n' to advance to the
next 20 lines, but I think it meets all the other criteria.
Good luck!
Ted
.
- References:
- Read 20 lines when pressing n for next
- From: s9uzaa
- Read 20 lines when pressing n for next
- Prev by Date: Re: Read 20 lines when pressing n for next
- Next by Date: Re: use perl to draw Venn Diagram
- Previous by thread: Re: Read 20 lines when pressing n for next
- Next by thread: FAQ 3.9 Is there a ctags for Perl?
- Index(es):