GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   tech question (https://gfy.com/showthread.php?t=908338)

klinton 06-01-2009 05:07 PM

tech question
 
how to search all html files on server for one code line and then mass edit to remove that line ?
..........:1orglaugh :( ehh... thx

HorseShit 06-01-2009 05:23 PM

http://www.flaminghomos.com/lol.jpg

klinton 06-01-2009 05:29 PM

yes. thank you. that was very nice of you. you are so funny

Swish 06-01-2009 05:30 PM

find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

You'll have to regex escape the search_text but that's how I would do it.

If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name

Swish 06-01-2009 05:31 PM

Make sure your file are backed up anyway before trying this obviously in case you fuck something up ;

klinton 06-01-2009 05:31 PM

Quote:

Originally Posted by Swish (Post 15915249)
find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

You'll have to regex escape the search_text but that's how I would do it.

If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name

:thumbsup:thumbsup
Thx ! I will try it...
i need to get rid off iframe malware......

Cyber Fucker 06-01-2009 05:45 PM

Quote:

Originally Posted by Justin (Post 15915230)

Hey, this was a tech question, I don't really want to watch this dirty ass pic in all threads... It's already enough of this kind of stuff in sigs and avatars :Oh crap

who 06-01-2009 06:07 PM

Quote:

Originally Posted by Swish (Post 15915249)
find / -type f -name *.html -exec grep -l "search_text" {} \; | perl -pi -e 's/search_text//g'

You'll have to regex escape the search_text but that's how I would do it.

If you want to make a backup of the files before changing them make it 'perl -pi.bak -e' for that part instead which will copy the chaged file and add '.bak' to the name

Sir, you assume too much.


All times are GMT -7. The time now is 11:54 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123