I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with DTP. I want to substring the date part and compare with today's date. If it is older than today, I want to replace with today's date. Here is an example.
$ cat temp.txt
RTG*888*TD8*20180201-20180201~
TWW*888*RD8*20180201-20180201~
RTG*888*TD8*20180201-20180201~
KCG*888*TD8*20180201-20180201~
I want the output as below by changing date. Please help. I am looking for UNIX script to make it work for all files present in that directory
RTG*888*TD8*20190424-20190424~
TWW*888*RD8*20180201-20180201~
RTG*888*TD8*20190424-20190424~
KCG*888*TD8*20180201-20180201~
Thanks in advance