Re: [PATCH v2] rebase -i: respect core.commentchar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Keeping <john@xxxxxxxxxxxxx> writes:

>> 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 "\\/".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]