So I created this little guy to help me out. Whenever run, he generates a date line in html that looks like this on a web page:
Last updated Wednesday December 15 2010
and updates a footer file I’ve called foot.tpl
change the Last updated part of foot.tpl
generate nice looking date command
DATE="$(date "+%A %B %e %Y")"
FINAL="$(echo $MYVAR $DATE $END)"
we are going to look for any line that has the word updated and replace that whole line with our new one now contained in the variable FINAL
" foot.tpl > footnew.tpl
mv footnew.tpl foot.tpl```
And thats it! For me, the word “updated” only shows up once in my foot.tpl so the old line is completely removed and replaced with the new one.