The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Printing specified lines only Mohit623 Shell Programming and Scripting 4 01-03-2008 05:55 AM
Suppress error message in unzip skwyer Shell Programming and Scripting 5 09-26-2007 02:20 PM
Printing lines with specific awk NF jehrome_rando Shell Programming and Scripting 1 03-13-2007 01:23 AM
Printing out whole lines in .ksh script L_Smith Shell Programming and Scripting 2 07-18-2006 05:51 PM
question about printing number of lines in a file a8111978 UNIX for Dummies Questions & Answers 5 09-17-2002 07:15 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-12-2003
Registered User
 

Join Date: Oct 2003
Location: Bangalore, India
Posts: 5
Suppress last N lines printing

Hi,

I want to know different ways of suppressing printing of last N lines.

Can anyone help?

Thanks,
Sree
Reply With Quote
Forum Sponsor
  #2  
Old 11-12-2003
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
This is pretty vague.. you'll have to be a lot more specific for anyone to give you a meaningful answer! If you want to display a the first n lines at the beginning of the file, look into the head command. It doesn't look like this is what you want though, but it'd more helpful to know exactly what you're trying to do.

------
There's probably a nice short way to do this, but a short script like this would work:

linesToSkip=10
b=`wc -l < yourFile`
head -n `expr $b - $linesToSkip` yourFile

Last edited by oombera; 11-12-2003 at 11:37 AM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:44 AM.


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

Content Relevant URLs by vBSEO 3.2.0