probably an extraordinarily dumb question
Date: 06/26/06
(Web Development) Keywords: html
What's the simplest way to do a search and replace across multiple files and multiple directories in order to change a character string unique to each file into a string consistent across all files?
Say I've got a bunch of directories like kittycats, goldfish, puppydogs, etc. I've got a bunch of index.html files in each of these directories, and each of these file has references to other files in the directory. For example, the kittycats one has references like this:
/home/kittycats/pictures.html
And the puppydogs one has
/home/puppydogs/pictures.html
And the same sort of thing applies for the other directories.
What I want to do is search on everything between /home/ and /pictures.html across all the directories and change them all to just:
/home/snugglywuggly/pictures.html
I'm thinking regular expressions, but I don't know enough about regular expressions to do it properly. Any suggestions/assistance will be greatly appreciated.
Source: http://community.livejournal.com/webdev/331422.html