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 "controller".
I think that you can get this for DOS. It's native on
most *NIX systems (*BSD, Linux, etc).
On 15-Jun-2001, Andrew Smith wrote:
> 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 copy out "n" number of lies before or after that
> > keyword.
> >
> > Any help would be greatly appriciated.
> >
> > Chris
> >
> > [EMAIL PROTECTED]
> --
> ---------------------------------------------------------------------------
> ** Andrew W. Smith ** [EMAIL PROTECTED] ** Chief Network Engineer **
> ** http://www.neosoft.com/neosoft/staff/andrew ** 1-888-NEOSOFT **
> ** NeoSoft, Inc. An Internet America Company 1-800-BE-A-GEEK **
> ** "Opportunities multiply as they are seized" - Sun Tzu **
> ---------------------------------------------------------------------------
--
---------------------------------------------------------------------------
** Andrew W. Smith ** [EMAIL PROTECTED] ** Chief Network Engineer **
** http://www.neosoft.com/neosoft/staff/andrew ** 1-888-NEOSOFT **
** NeoSoft, Inc. An Internet America Company 1-800-BE-A-GEEK **
** "Opportunities multiply as they are seized" - Sun Tzu **
---------------------------------------------------------------------------
Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=8784&t=8761
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]