On Sunday 20 May 2001 19:23, Kevin Donnelly wrote:
Does anyone know of a script or something that will replace about 20 lines of HTML in about 100 files on a remote Unix webserver? Most of the scripts I have seen do phrases or words, but not a big chunk like this.
Thanks Kevin
If the 20 lines you want to change is *exactly* identical in all files (same text, same place in file) this has worked for me: - Get one of the files from the website 'oldfile' - Make changes and save it as 'newfile' - Create an ed(1) script with diff(1): diff -e oldfile newfile >edscript - Edit 'edscript' and add a 'w' on last line to write the file - MAKE A BACKUP OF EXISTING FILES JUST IN CASE - Run ed on all the files you want to change for f in some-pattern do cat edscript | ed $f done -- Groete | Greetings | Grüßen | Salutations Piet le Roux