* doc/coreutils.texi (echo invocation): Parameterize the escape list.
(printf invocation): Remove the C escape reference as it mentions
\' which we don't support, and doesn't mention \e which we do support
(and GCC also does). Instead directly present the escape list
as done for the echo command, adjusted accordingly.
Enable interpretation of the following backslash-escaped characters in
each @var{string}:
Enable interpretation of the following backslash-escaped characters in
each @var{string}:
+@item \\\\
+backslash
+@ifset PRINTF_COMMAND
+@item \\"
+double quote
+@end ifset
+@item \\a
produce no further output
produce no further output
-@item \\
-backslash
-@item \0@var{nnn}
+@ifclear PRINTF_COMMAND
+@item \\0@var{nnn}
the eight-bit value that is the octal number @var{nnn}
(zero to three octal digits), if @var{nnn} is
a nine-bit value, the ninth bit is ignored
the eight-bit value that is the octal number @var{nnn}
(zero to three octal digits), if @var{nnn} is
a nine-bit value, the ninth bit is ignored
+@end ifclear
+@item \\@var{nnn}
the eight-bit value that is the octal number @var{nnn}
(one to three octal digits), if @var{nnn} is
a nine-bit value, the ninth bit is ignored
the eight-bit value that is the octal number @var{nnn}
(one to three octal digits), if @var{nnn} is
a nine-bit value, the ninth bit is ignored
the eight-bit value that is the hexadecimal number @var{hh}
(one or two hexadecimal digits)
the eight-bit value that is the hexadecimal number @var{hh}
(one or two hexadecimal digits)
+@ifset PRINTF_COMMAND
+@item \\u@var{hhhh}
+Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits)
+@item \\U@var{hhhhhhhh}
+Unicode character with hex value HHHHHHHH (8 digits)
+@end ifset
+@end macro
+@escapeSequences
@optItem{echo,-E,}
@cindex backslash escapes
@optItem{echo,-E,}
@cindex backslash escapes
and C language escape sequence processing.
@xref{Output Conversion Syntax,, @command{printf} format directives,
libc, The GNU C Library Reference Manual}, for details.
and C language escape sequence processing.
@xref{Output Conversion Syntax,, @command{printf} format directives,
libc, The GNU C Library Reference Manual}, for details.
-See also @uref{https://en.cppreference.com/w/c/language/escape,
-C99 string escapes:}.
-Examples of supported conversion specifiers and flags are:
+@mayConflictWithShellBuiltIn{printf}
+
+Supported escape sequences are:
+
+@indentedblock
+@set PRINTF_COMMAND
+@escapeSequences
+@clear PRINTF_COMMAND
+@end indentedblock
+
+Supported conversion specifiers with examples are:
@example
CONVERSION Shell format example Output
@example
CONVERSION Shell format example Output
%q '%q ' 'a' ';b' $'c\n' a ';b' 'c'$'\n'
@end example
%q '%q ' 'a' ';b' $'c\n' a ';b' 'c'$'\n'
@end example
-@mayConflictWithShellBuiltIn{printf}
-
The differences from the C @samp{printf} function are:
@itemize @bullet
The differences from the C @samp{printf} function are:
@itemize @bullet