How to insert strings containing slashes with sed?

前端 未结 11 917
别那么骄傲
别那么骄傲 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:05

    A very useful but lesser-known fact about sed is that the familiar s/foo/bar/ command can use any punctuation, not only slashes. A common alternative is s@foo@bar@, from which it becomes obvious how to solve your problem.

提交回复
热议问题