[thelist] SOLVED: Making same modification to large number of files

Austin Harris austin at dotmail.co.uk
Fri Feb 9 10:41:29 CST 2007


Make a file called footer.php* with the content in.

Instead of having the content hard coded 300 times just put include ('/footer.php') or whatever. Next time just change footer.php not 300 odd files

*or whatever flavour you want

Austin

----- "Barney Carroll" <barney at textmatters.com> wrote:
> Joel D Canfield wrote:
> > so, I was hoping that, rather than just finding an elaborate
> solution
> > which you'll just have to use again next time, you'd find an
> elaborate
> > solution you could use just once, make the footer an server side
> > include, and then next time, just change the include instead of all
> the
> > files.
> 
> Sorry Joel, I'm not deciphering this!
> 
> I had a few hundred pages of static, hard-coded HTML on a unix machine
> I 
> was accessing through ssh - and all of them had an identical piece of
> 
> text that needed the same modification across the board.
> 
> The program I used meant that I iterated the modification once, and it
> 
> instantly searched and replaced for all those files.
> 
> All it required was creating a small file with particular sed syntax,
> 
> mostly consisting of the string I was searching for and the string I 
> wanted to substitute, and then I told sed to run this file, which did
> 
> all the work.
> 
> It was pretty easy. Turns out there is a perl version of sed which can
> 
> do the same thing without the messiness of having to create a file,
> but 
> I'm not really that bothered.
> 
> 
> Regards,
> Barney
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt !




More information about the thelist mailing list