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

cd /var/www/

generate nice looking date command

DATE="$(date "+%A %B %e %Y")"


Last updated"




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

sed "

/updated/ c\


" 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.

Very useful.

Blog Logo

Mario Loria




Because gets old after a while.

Back to Overview