Why does sed require 3 backslashes for a regular backslash?

后端 未结 7 1598
余生分开走
余生分开走 2020-11-29 01:26

I\'m curious, why does sed need 3 \\ just to recognize one? I\'d understand it needing 2, but 3 I don\'t.

EDIT: here\'s an example on my Windows compute

相关标签:
7条回答
  • 2020-11-29 02:14

    Replacing one backslash with two on my Cygwin requires this expression:

    sed -e "s|\\|\\\\|g"

    0 讨论(0)
提交回复
热议问题