in reply to Print Lines above and below string
On the command line: grep -n5 "search_string" filename
If you want to use it in your code
my $result = `/usr/bin/grep -n5 "search_string" $file`; print $result;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Print Lines above and below string
by coding_new (Sexton) on Aug 10, 2011 at 15:21 UTC | |
by duyet (Friar) on Aug 10, 2011 at 15:25 UTC |