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 -->
  #8 (permalink)  
Old 05-17-2008
ShawnMilo ShawnMilo is offline
Registered User
 

Join Date: Jun 2006
Posts: 154
This is not memory-intensive, and will work.

Code:
cat filename | perl -ne 'push(@a, $_); print shift(@a, ) if  $#a >=3 ;'
Reply With Quote