Looking for an example of a script that will search a file ( like a cisco
config file )
find a key word and then copy out n number of lies before or after that
keyword.
Any help would be greatly appriciated.
Chris
[EMAIL PROTECTED]
Message Posted at:
grep -A -B
-A prints n lines of trailing data after the matching line
-B prints n lines of trailing data before the matching line
On 15-Jun-2001, Hayes, Christopher wrote:
Looking for an example of a script that will search a file ( like a cisco
config file )
find a key word and then
On Fri, 15 Jun 2001, Hayes, Christopher wrote:
Looking for an example of a script that will search a file ( like a cisco
config file )
find a key word and then copy out n number of lies before or after that
keyword.
Any help would be greatly appriciated.
You didn't say what your
Hmm, strange, anyway it looks like the mailing list stripped
everything in greater-than/less-than.
grep -A 3 -B 5 controller core1-confg
That would find all instances of controller in the file
core1-confg and print the three lines above, the line,
and the 5 lines after all instances of
4 matches
Mail list logo