Answer the question
In order to leave comments, you need to log in
Pasting text into index.html from bash?
The essence of the problem is what. There is a code, conditionally Yandex metric. The code uses a lot of special characters (pipes, quotes, etc.), you need to insert this code from the shell into index. The index has a label where to insert it (a certain keyword that can be replaced with a code. The code is conditionally in the file. I tried SED, but due to the presence of an abundant number of special characters, this is very problematic.
Answer the question
In order to leave comments, you need to log in
Well, if there is only one place to insert, then it's easier to split index.html into 2 files, before the keyword and after.
Then output these files to the resulting file mixed with the desired code
cat before.index.html > index.html
mysupercommand >> index.html
cat after.index.html >> index.html
stackoverflow.com/a/6215113/2504704
blog .lavoie.sl/2012/11/simple-templating-system-us...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question