![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
echo "23:23:23" | awk -F":" '{ print $1$2 }'
|
|
#3
|
|||
|
|||
|
thank u vino
u served my purpose regards rajan |
|
#4
|
|||
|
|||
|
one more way,
echo "23:23:20" | sed -e 's/://;s/:.*//' |
|||
| Google The UNIX and Linux Forums |