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 04-11-2005, 11:22 PM   #1
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
Linux/Unix gurus...

Yo,
Just wanting to know what command I could use to go through all sub directories and search THROUGH html files and replace </html> with <a href=.....</a></html>
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-11-2005, 11:29 PM   #2
darnoth
Confirmed User
 
Join Date: Jan 2005
Posts: 105
perl -pi -e '\s/old/new/' filemask .. so:
perl -pi -e '\s/<\/html>/<a href=http:\/\/www.yahoo.com\/search/' *
That only does the current directory, but you can do */*, then */*/* etc. You'll notice I put \'s in front of the /'s, thats because those are special characters, and you need to "escape" them by putting those there. You should put \'s in front of " characters as well if you use them in the href. I suggest creating a test file and testing it on that until you get it right .
darnoth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-11-2005, 11:32 PM   #3
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
thanks a bunch darnoth!
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:12 AM   #4
INDK
Confirmed User
 
Join Date: Jan 2004
Location: Edmonton, Alberta
Posts: 75
Not quite darnoth.

USE AT YOUR OWN RISK

First, make a backup of that directory. Then edit the obviously phony (capitalized) variables in this command to your liking:

Code:
find /PATH/TO/DIRECTORY/GOES/HERE/ -type f -name "*.html" | while read f; do perl -pe 's,\</html\>,<a href="LINKGOESHERE">HYPERTEXT</a></html>,' "$f" > "$f".new; mv "$f".new "$f"; done
...will recursively scan through /www/directory/goes/here and replace </html> with <a href="LINKGOESHERE">HYPERTEXT</A> in every single HTML file in that directory. Don't run this more than once.

INDK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:31 AM   #5
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
INDK cheerS!
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:40 AM   #6
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
hmm neither seemed to work

the idea is to put in .sh file and run, right?
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:51 AM   #7
INDK
Confirmed User
 
Join Date: Jan 2004
Location: Edmonton, Alberta
Posts: 75
No, just run it.

Describe the error.
INDK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:53 AM   #8
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
it seems to run.. no errors..but no resumes
does it matter if the </HTML> is </HTML> or </html> ?
and do I have to put \ in front of the " and <, >'s
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 12:58 AM   #9
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
ahh.. it seems to work now.. thx a heaps INDK!
__________________
I dont need a sig.
EddiePulp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-12-2005, 01:09 AM   #10
EddiePulp
Confirmed User
 
Join Date: Mar 2004
Location: Australia iCQ:408018496
Posts: 1,332
INDK, thanks again.. if you could, hit me up on icq 7278746

cheers
__________________
I dont need a sig.
EddiePulp 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.