Character escaping in item name

Carlos Carvalho carlos at fisica.ufpr.br
Mon Apr 19 18:48:28 MDT 2010


Richard Taubo (ort at bergersen.no) wrote on 19 April 2010 14:48:
 >In the rsync man page under " -8, --8-bit-output", it says:
 >	. . .
 >	All control characters (but never tabs) are always escaped, regardless of this option's setting.
 >	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).
 >
 >Is there a list somewhere where I can find:
 >	a) Which control characters will be escaped?

The ones which have value below space, that is less than 32 (decimal)
in the ascii table.

 >	b) What digits the escaped control characters will get?

Explained in your quote of the manual.

 >I was thinking b) would be the similar to the appropriate ascii code, 
 >but since LF has ascii code 10 and CR har ascii code 13,
 >I was having problems finding the right code e.g. "\#012" for newline.

It's not written in base 10, it's in base 8.


More information about the rsync mailing list