Answer the question
In order to leave comments, you need to log in
How to bulk replace a piece of text from several lines in multiple files?
Good afternoon.
The server hosts many sites with the same type of templates and .htaccess. There was a need to immediately change one block in the template on all sites and slightly correct .htaccess.
The problem is that you need to edit blocks with text on several lines.
How can I do this?
Answer the question
In order to leave comments, you need to log in
Basically, you can just do one monstrous replacement command with sed.
Unfortunately, it's best to use not bash, sed is great for a line in this regard, but full-fledged regular expressions with a line break, etc., are better to use php.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question