1

Replace date on a line with current date

view story
linux-howto

http://www.unix.com – Hi Guys, I have a file with following content Code: From 20121014 : To 20121014 Number of days : 1 1234 1245 1246 1111 Everyday i run my script i want to modify "To" date on the first line with current date. I have set the current date in script as Code: RUN_DATE=`date -u +%Y%m%d` So i want to replace "To" date with $RUN_DATE. The "From" date never changes. Also, i want to replace on second line (toDate-fromDate)+1. Right now it is 1. So when it runs tomorrow it should be 2. Thanks - jak (HowTos)