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
I was able to reproduce this behavior using Vista and Cygwin 1.7.0.
Two backslashes become a single backslash in the shell which then in sed escapes the forward slash which is the middle delimiter.
\\/ -> \/ (which makes the forward slash a regular character instead of a delimiter)
Three of them: The first two become one in the shell which then escape the third one in sed
\\\/ -> \\/
Four: Each pair become single ones in the shell then the first resulting one escapes the second in sed
\\\\/ -> \\/
Edit:
Oh, I forgot to say that both single quotes and double quotes worked the same for me (cmd.exe
doesn't make the distinction that Bash, et al, makes).