The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
print line whatever line i want in a file... there any way kittusri9 Shell Programming and Scripting 1 05-15-2008 09:37 AM
How to print 3rd to last line of file? NivekRaz Shell Programming and Scripting 2 09-10-2007 05:04 PM
how to print out line numbers of a text file? forevercalz Shell Programming and Scripting 4 12-12-2005 02:04 AM
Print file line by line handak9 Shell Programming and Scripting 2 10-20-2005 05:44 AM
Print one line of Existing File danhodges99 UNIX for Dummies Questions & Answers 2 02-25-2003 08:56 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 05-14-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,618
Quote:
Originally Posted by matrixmadhan
This would still continue validating even after the 'n'th line has been selected and printed. Hence IMHO exit should be used !
But I'm pretty sure that the same is true of your perl solution. And it is definately true of the sed solution as well.
sed -n '35{p;q;}'
is a bit faster for large files.
Reply With Quote
Forum Sponsor
  #9  
Old 05-15-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by Perderabo
But I'm pretty sure that the same is true of your perl solution. And it is definately true of the sed solution as well.
sed -n '35{p;q;}'
is a bit faster for large files.

Thats a catch ! I surrender

I should have used ' last ' for the perl solutiohn !
Reply With Quote
  #10  
Old 05-15-2007
Registered User
 

Join Date: Dec 2006
Location: Maryland
Posts: 144
cat filename | head -35 | tail -1
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:10 PM.


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