Re: Date from the time stamp



On 28 Sep 2006 08:46:10 -0700, pawan_test wrote:
i have a time stamp. from that i am trying to awk to get the year,
month and date.

TIME=20060614092446

DESIRED OUTPUT: 20060614

i am doing the following;

TIME=20060614092446
$ TimeStarted=`expr match '$TIME' '.*\(......\)'`
echo $TimeStarted

i am not getting any output. can anyone please suggest me.
[...]

set $(echo "$TIME" | fold -w2)
y=$1$2
m=$3
d=$4

--
Stephane
.