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.

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2005
Registered User
 

Join Date: Sep 2005
Posts: 128
Stumble this Post!
Red face please help

Dear friends



time is like this 23:23:20

Now i want to read like this
2323 means i dont want colon between hours and minutes and i should leave seconds


so at last i want 2323 from above mentioned time

i think awk will solve my problem

please unix shell script syntax


urgent

regards

rajan
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-26-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,658
Stumble this Post!
Code:
echo "23:23:23" | awk -F":" '{ print $1$2 }'
Reply With Quote
  #3 (permalink)  
Old 10-26-2005
Registered User
 

Join Date: Sep 2005
Posts: 128
Stumble this Post!
thank u vino

u served my purpose


regards

rajan
Reply With Quote
  #4 (permalink)  
Old 10-26-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,547
Stumble this Post!
one more way,

echo "23:23:20" | sed -e 's/://;s/:.*//'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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


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