The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
22 views

How to substitute a string from an awk result?

I have a JSON file which contain multiple occurrence of replaceme. I only want to substitute an occurrence based on a specific string found a few line above. E.g., [...] "title" : { ...
0
votes
0answers
87 views

Optimize performance of subs_filter or LUA gsub on Nginx for large streams

I need to make multiple substitutions on a page, served via Nginx. I know that standard sub_filter module doesn't work here, because is limited to a single substitution. So, I came up with two ...
0
votes
3answers
159 views

Change URL in Source with reverse proxy?

sometimes we make copies of live sites on another server to test new features. A lot of CMS systems hardcode the URL in the database, so it is not possible to just use another URL. On our local ...
2
votes
2answers
588 views

How do i use the {} operator in find execution inside exec

I tried this bash command: find /var/www/ -path '*wp-admin/index.php' -exec mv {} $(dirname {})/index_disabled But the second {} is not executed. It results in just ./index_disabled instead. How ...
1
vote
1answer
193 views

String search and replace across an entire database

After an exploit on an ASP.NET site, the client was left with a specific string of malware code sprayed across the entire database, multiple columns of multiple tables. The prepended string is ...
-2
votes
3answers
3k views

sed replace text - escape characters

I have a mysqldump file in which I want to replace the following text <a href="/tag/ with <a href="http://www.mydomain.com/tag/ but can't find a way to correctly escape all special characters. ...
0
votes
2answers
410 views

Search and Replace in .htaccess files in linux

I need to add this line to every .htaccess file that is located in a /home/*/site/assets/.htaccess where * can be any amount of directories deep I need to fine this text RewriteRule ^(.*)$ ...
1
vote
1answer
445 views

search and replace ldap attribute

I have a reasonably large set of data in an LDAP server. Some of the attributes appear in many places, and I would like to replace them. The data is not enormous, but it is enough to rule out editing ...
0
votes
2answers
590 views

lighttpd: modifying / adding content to response?

for nginx there's a very nice module available to filter a response and search/replace content in it: http://wiki.nginx.org/HttpSubModule i wonder, if there's a similar possibility for lighttpd ...
-1
votes
1answer
682 views

Mass search / replace string from ssh?

I am in the process of selling a network of 60 sites, they all have adsense with the same publisher id (google_ad_client="pub-xxxxxxxxxxxxxxxx") in all the files in the /home/ folder. How can I do a ...
1
vote
5answers
1k views

Utility to search and replace text in files including subdirectories in Windows

For Linux, sed and find are an easy option to search and replace in many files including subdirectories. Is there a way to do the same in Windows (with or without PowerShell)?
0
votes
1answer
2k views

How to replace text string in any type file(for example binary and …) and multiple files in linux?

I want to replace text string in any type file(for example perl,cgi,text,binary,js and ...) in multiple folder in linux. How do i do? Tanks.
0
votes
1answer
365 views

Mod_Rewrite Modify Query String Help

I need some assitance with a mod_rewrite rule. I am setting up a SEO Friendly director of names and have run into some problems I know there is an easy answer for but I cant get it to work to save my ...
3
votes
4answers
3k views

How to replace a text string in multiple files in Linux

There are a variety of ways to replace one string of text with another across many files. Here are a few ways: using sed and find: sed 's/oldstring/newstring/' "$1" > "$1".new && find ...
3
votes
2answers
836 views

Replace Wildcard Character in Filenames

I can't get this to work: I have hundreds of files that our database developer has foolishly put asterisks in, so that we have files named like this: *1*_Floorplan.jpg I need to recursively (two ...
1
vote
2answers
393 views

How can I replace all instances of a specified string in a text file with another string?

I have a file a.txt. I would like to replace all instances of "1.6" with "1.5" in that file, overwriting the original file.
2
votes
3answers
428 views

Tool for multiple pattern search and replace

I am looking for an easy to use tool that will allow me to have batch of search/replace pairs. Rolling out to different environments requires us to search/replace server names in database scripts. I ...