Script to extract a few lines of code from a file [7:8761]

2001-06-15 Thread Hayes, Christopher
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:

Re: Script to extract a few lines of code from a file [7:8761]

2001-06-15 Thread Andrew Smith
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

Re: Script to extract a few lines of code from a file [7:8761]

2001-06-15 Thread ElephantChild
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

Re: Script to extract a few lines of code from a file [7:8761]

2001-06-15 Thread Andrew Smith
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