|
|
|
|
Re: Date formatting in unix shell script [message #295771 is a reply to message #295769] |
Wed, 23 January 2008 06:36 |
vanathi
Messages: 74 Registered: December 2007 Location: India
|
Member |
|
|
I tried it another way and got it.
mVar=01172008 --> consider
mYear=`echo $mVar | cut -c 5-8`
mDay=`echo $mVar | cut -c 3-4`
mMth=`echo $mVar | cut -c 1-2`
mAllMths='Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'
mMthOut=`echo ${mAllMths} | cut -d' ' -f${mMth}`
filegendatetime="$(echo ${mDay}'-'${mMthOut}'-'${mYear})"
This is working now.
Thanks for your effort.
[Updated on: Wed, 23 January 2008 06:38] Report message to a moderator
|
|
|