On 08/22/2014 11:33 PM, Cristian Rodríguez wrote:
El 22/08/14 a las #4, Lew Wolfgang escribió:
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?
Thanks in advance for any advice, Lew
Since people already gave you sane solutions, here is a crazy one.. Use apache mod_ext_filter :-)
ExtFilterDefine fixlinks mode=output intype=text/html \ cmd="/bin/sed s/foobar.org/foobar.info/g"
<Location /> SetOutputFilter fixlinks </Location>
in your host configuration. then you are done.
ps:this is just an example, does not scale well, ain't going to be fast.
Thanks Cristian, that's interesting. But this would check all served content, wouldn't it? It could be bad if the string happened to appear in a binary file! Regards, Lew -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org