Adam Fields (weblog)

This blog is largely deprecated, but is being preserved here for historical interest. Check out my index page at adamfields.com for more up to date info. My main trade is technology strategy, process/project management, and performance optimization consulting, with a focus on enterprise and open source CMS and related technologies. More information. I write periodic long pieces here, shorter stuff goes on twitter or app.net.

1/21/2005

Wrapping pages in a Dreamweaver template

Filed under: — adam @ 12:49 pm

This is a one-liner to add a very simple Dreamweaver wrapping template to all html/php files in a directory and all child directories. You’ll need to add a template called “template.dwt” with one editable region called “Content”. After you do this, you can make changes to the template and all of the files will be updated with the template changes. Of course, it’s also a model for a general universal string replace.

find . -type f \( -name “*.htm” -o -name “*.html” -o -name “*.php” \) -print0 | \
xargs -0 \
perl -p -i.bak \
-e ’s|||g;’ \
-e ’s|||g;’ \
-e ’s||‘ \
-e ’s||


Comments are closed.

Powered by WordPress