The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: awk help needed
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 11-18-2008
insamniac insamniac is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 14
the 'head -2' pulls the top two lines of the text file, the 'tail -1l' pulls the bottom of those 2, so it's the second line of the file. Yogesh's method is cleaner and doesn't require external unix commands, but I couldn't remember the awk variable to get the current row number..