Re: [PATCH v2] rebase -i: respect core.commentchar
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2013, 18:21 UTC
- Message-ID
- <7vip5xgzp6.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130212175322.GC13501@farnsworth.metanate.com>
John Keeping <john@keeping.me.uk> writes:
Show 14 quoted lines
>> I am not sure if I understand what you meant by "literal backslash >> blah blah", though. > > It turns out that having this in the script works (in bash and dash > although I haven't checked what Posix has to say about it): > > sed -e "2,$ s/^/\\\/" > > and is equivalent to: > > sed -e '2,$ s/^/\\/' > > because backslashes that aren't recognised as part of an escape sequence > are not treated specially.
That's POSIX. Inside a dq pair:
\
The <backslash> shall retain its special meaning as an escape
character (see Escape Character (Backslash)) only when followed by
one of the following characters when considered special:
$ ` " \ <newline>So in your example "\\\/", the first backslash escapes the second backslash and together they produce a single backslash, the third backslash is followed by a slash that is not special at all, so it produces a second backslash, and the slash stands for itself, resulting in "\\/".