![]() |
Linux GURUS pls help - mass replace
I have a problem.
I'd like to replace an URL in several .html files in several directories. The structure is like this: /dir /dir1/ html1.html html2.html html3.html /dir2/ somehtml1.html somehtml2.html somehtml3.html ..... I would like to replace an URL with another one in all files and in all directories (dir1, dir2, dir3...). Is this doable? Please help |
assuming xxx.html is to be replaced by yyy.html
for i in $(ls -1 *);do sed 's/xxx.html/yyy.html/g' $i ; done for i in $(ls -1 */*);do sed 's/xxx.html/yyy.html/g' $i; done |
Or dump the files to a non Linux and run a typical find and replace from Dreamweaver of the like.
|
Quote:
|
bah wintendo :)
|
rpl is a UN*X text replacement utility. It will replace strings with new strings in multiple text files. It can scan directories recursively and replace strings in all files found. It includes source, a build script, and a man page, and should work on most flavors of UN*X. Linux Intel, LinuxPPC, and Source RPMS are available on the website, as are binaries for other OSes.
Homepage http://www.laffeycomputer.com/software.html Download ftp://ftp2.laffeycomputer.com/pub/cu...pl-beta.tar.gz |
All times are GMT -7. The time now is 11:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123