The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 08-15-2007
summer_cherry summer_cherry is offline
Registered User
 

Join Date: Jun 2007
Location: Beijing China
Posts: 557
try this one

I think this can help you. Suppose you want to print the line from MIN to MAX:

Code:
awk 'BEGIN{min=2;max=5}
{
 if (NR>=min)
{
if(NR<=max)
print
}
}' filename
Reply With Quote