https://bugzilla.samba.org/show_bug.cgi?id=11656

Wayne Davison <way...@samba.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #10 from Wayne Davison <way...@samba.org> ---
The consistent and documented escaping is that some characters get ouput with a
backslash+hash+3-digit octal number. This includes control chars, some
backslashes, and (without -B) high-bit chars.  From the man page:

"The escape idiom that started in 2.6.7 is to output a literal backslash (\)
and a hash (#), followed by exactly 3 octal digits.  For example, a newline
would output as "\#012".  A literal backslash that is in a filename is not
escaped unless it is followed by a hash and 3 digits (0-9)."

One easy way to unescape is thus to filter names through something like this:

    perl -pe 's/\\#(\d\d\d)/chr(oct($1))/eg'

(...after any necessary parsing of the output to find the names or twiddle
newlines into nulls).  You'll note that this only matches exactly 3-digits, as
rsync will leave something like "\#5" alone in the output, since it cannot be
confused with an actual escaped char.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to