please help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting please help
# 1  
Old 10-26-2005
Power 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
# 2  
Old 10-26-2005
Code:
echo "23:23:23" | awk -F":" '{ print $1$2 }'

# 3  
Old 10-26-2005
thank u vino

u served my purpose


regards

rajan
# 4  
Old 10-26-2005
one more way,

echo "23:23:20" | sed -e 's/://;s/:.*//'
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question