Script for time stamp update.

scmuser created the topic: Script for time stamp update.

write a batch Script for time stamp update?

sgadmin replied the topic: Re:Script for time stamp update.

data=data.txt
tfile=`cat data.txt |wc -l`


for (( i = 2 ; i <= tfile ; i++ ))
do

mfile=`cat $data |head -$i|tail -1|tr -s ” ” ” ” |cut -f8 -d” “`
mdate=`grep -i $mfile $data|tr -s ” ” ” “|cut -f6,7 -d” “`
myy=`echo $mdate |cut -b 1-4`
mon=`echo $mdate |cut -b 6-7`
mdd=`echo $mdate |cut -b 9-10`
mhh=`echo $mdate |cut -b 12-13`
mmin=`echo $mdate |cut -b 15-16`
mresult=`echo $myy$mon$mdd$mhh$mmin`
touch -t $mresult $mfile

done

Tagged :
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x