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
Small question regarding SSH Legend986 UNIX for Dummies Questions & Answers 2 12-17-2007 02:25 AM
A small minix question sasa Shell Programming and Scripting 2 05-21-2007 02:20 PM
How to use awk substr ? sabercats Shell Programming and Scripting 1 02-10-2006 04:01 PM
small question of echo | grep command kfad Shell Programming and Scripting 5 05-02-2005 08:12 AM
small question janr Shell Programming and Scripting 9 09-19-2002 11:50 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2006
Registered User
 

Join Date: Jan 2006
Posts: 71
small question regarding substr()

Hello..

I am doing some awk-ing and among all I use substr inside it..

I have: ....substr($0,60,37)

meaning as U all know take from 37 char. from point 60..

can I put it like this substr($0,60,end of line)

meaning take it from point 60 and take all characketrs in that line until line is over..

stupit q?? but is there good answer on it?? )))

cheers,
Reply With Quote
Forum Sponsor
  #2  
Old 06-21-2006
tayyabq8's Avatar
Moderator
 

Join Date: Nov 2004
Location: Bahrain
Posts: 555
Skipping 3rd argument will give you the desired result, means you could try substr($0,37) it'll give you from position 37 till eol.
Reply With Quote
  #3  
Old 06-22-2006
Registered User
 

Join Date: Jan 2006
Posts: 71
that works fine...thanks a lot..
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:37 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