The UNIX and Linux Forums  

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


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
delete first 100 lines from a file salaathi SUN Solaris 3 11-15-2007 12:01 AM
delete first 100 lines rather than zero out of file thepurple SUN Solaris 7 11-14-2007 09:35 AM
delete the lines from file sameersam Shell Programming and Scripting 2 04-03-2006 10:32 PM
Delete lines in a file umal Shell Programming and Scripting 6 02-08-2006 09:08 AM
delete all lines in file strok UNIX for Dummies Questions & Answers 6 03-11-2002 06:27 PM

Reply
 
LinkBack Thread Tools Display Modes
  #8 (permalink)  
Old 05-17-2008
Registered User
 

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

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

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0