Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-23-2006, 04:14 AM   #1
Gasper
Guest
 
Posts: n/a
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
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-23-2006, 04:22 AM   #2
PussyTeenies
Confirmed User
 
Join Date: Feb 2005
Location: Haarlem and Amsterdam, capital of the porn world ;-)
Posts: 6,496
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
__________________
Need adult hosting?

Contact us!
WARM Hosting

Need an IT solution? or someone to check your site and security? Nossie - IT Professional
PussyTeenies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-23-2006, 04:23 AM   #3
munki
Do Fun Shit.
 
munki's Avatar
 
Industry Role:
Join Date: Dec 2004
Location: OC
Posts: 13,393
Or dump the files to a non Linux and run a typical find and replace from Dreamweaver of the like.
__________________

I have the simplest tastes. I am always satisfied with the best.” -Oscar Wilde
munki is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-23-2006, 04:26 AM   #4
3M TA3
Confirmed User
 
Join Date: Aug 2005
Location: So Cal
Posts: 2,972
Quote:
Originally Posted by MikyMunki
Or dump the files to a non Linux and run a typical find and replace from Dreamweaver of the like.
yeah, works for me.
__________________

Dedicated and colo hosting: ICQ 291313057

"A problem cannot be solved from the same consciousness that created it. We must learn to see the world anew." - Albert Einstein
3M TA3 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-23-2006, 06:52 AM   #5
PussyTeenies
Confirmed User
 
Join Date: Feb 2005
Location: Haarlem and Amsterdam, capital of the porn world ;-)
Posts: 6,496
bah wintendo
__________________
Need adult hosting?

Contact us!
WARM Hosting

Need an IT solution? or someone to check your site and security? Nossie - IT Professional
PussyTeenies is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-23-2006, 07:19 AM   #6
MickeyG
Confirmed User
 
Join Date: May 2004
Location: South Florida
Posts: 4,134
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
MickeyG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.