How to insert strings containing slashes with sed?

前端 未结 11 956
别那么骄傲
别那么骄傲 2020-11-22 04:44

I have a Visual Studio project, which is developed locally. Code files have to be deployed to a remote server. The only problem are the URLs they contain, which are hard-cod

11条回答
  •  梦谈多话
    2020-11-22 05:06

    Great answer from Anonymous. \ solved my problem when I tried to escape quotes in HTML strings.

    So if you use sed to return some HTML templates (on a server), use double backslash instead of single:

    var htmlTemplate = "
    ";

提交回复
热议问题