The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How to print specific lines with awk
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
How to print specific lines with awk
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
08-15-2007
summer_cherry
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
summer_cherry
View Public Profile
Find all posts by summer_cherry