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 **
---------------------------------------------------------------------------




Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=8768&t=8761
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]

Reply via email to