Thread: tech question
View Single Post
Old 06-01-2009, 06:07 PM  
who
So Fucking Banned
 
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
Quote:
Originally Posted by Swish View Post
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.
who is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote