Lew Wolfgang wrote:
Hi Folks,
I've got a web site that's being "retired", so to speak, and will be replaced with a shiny new presentation. But I want to keep the old one on-line for historical reference at a different domainname. For example, the domain hosting the new content would be foobar.org, the one I want to keep for history would be foobar.info. So I need to go through the old html and substitute any references of foobar.org to foobar.info. There are 3705 separate lines in probably 1000 files in a large filesystem hierarchy containing the string that needs swapping. I'd rather not do it by hand!
What would you use? awk? A shell script? Something using grep and sed?
try this shellscript: $!/bin/bash WEBSITEROOT=/srv/web/site/original COPY=/srv/web/site/modified cp -R $WEBSITEROOT $COPY # recursive copy of the website directory tree cd $COPY # go to copy find . -exec ( sed -e " s/foober.info/foobar.org/g " \{\} > tmp.$$ ; mv tmp.$$ \{\}) \; It's safe, because it only modifies the copy. And you can run it over and over
Thanks in advance for any advice, Lew
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org