Mon Mar 12 00:42:06 2018 UTC ()
Explicitly mention use of -- for format strings beginning with -,
per PR 21970.


(dholland)
diff -r1.25 -r1.26 src/usr.bin/printf/printf.1

cvs diff -r1.25 -r1.26 src/usr.bin/printf/printf.1 (switch to unified diff)

--- src/usr.bin/printf/printf.1 2014/04/13 01:45:34 1.25
+++ src/usr.bin/printf/printf.1 2018/03/12 00:42:05 1.26
@@ -1,411 +1,418 @@ @@ -1,411 +1,418 @@
1.\" $NetBSD: printf.1,v 1.25 2014/04/13 01:45:34 snj Exp $ 1.\" $NetBSD: printf.1,v 1.26 2018/03/12 00:42:05 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1989, 1990, 1993 3.\" Copyright (c) 1989, 1990, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to Berkeley by 6.\" This code is derived from software contributed to Berkeley by
7.\" the Institute of Electrical and Electronics Engineers, Inc. 7.\" the Institute of Electrical and Electronics Engineers, Inc.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the 15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution. 16.\" documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors 17.\" 3. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software 18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission. 19.\" without specific prior written permission.
20.\" 20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" from: @(#)printf.1 8.1 (Berkeley) 6/6/93 33.\" from: @(#)printf.1 8.1 (Berkeley) 6/6/93
34.\" 34.\"
35.Dd May 6, 2008 35.Dd March 11, 2018
36.Dt PRINTF 1 36.Dt PRINTF 1
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm printf 39.Nm printf
40.Nd formatted output 40.Nd formatted output
41.Sh SYNOPSIS 41.Sh SYNOPSIS
42.Nm 42.Nm
43.Ar format 43.Ar format
44.Op Ar arguments ... 44.Op Ar arguments ...
45.Sh DESCRIPTION 45.Sh DESCRIPTION
46.Nm 46.Nm
47formats and prints its arguments, after the first, under control 47formats and prints its arguments, after the first, under control
48of the 48of the
49.Ar format . 49.Ar format .
50The 50The
51.Ar format 51.Ar format
52is a character string which contains three types of objects: plain characters, 52is a character string which contains three types of objects: plain characters,
53which are simply copied to standard output, character escape sequences which 53which are simply copied to standard output, character escape sequences which
54are converted and copied to the standard output, and format specifications, 54are converted and copied to the standard output, and format specifications,
55each of which causes printing of the next successive 55each of which causes printing of the next successive
56.Ar argument . 56.Ar argument .
57.Pp 57.Pp
58The 58The
59.Ar arguments 59.Ar arguments
60after the first are treated as strings if the corresponding format is 60after the first are treated as strings if the corresponding format is
61either 61either
62.Cm b , 62.Cm b ,
63.Cm B , 63.Cm B ,
64.Cm c , 64.Cm c ,
65or 65or
66.Cm s ; 66.Cm s ;
67otherwise it is evaluated as a C constant, with the following extensions: 67otherwise it is evaluated as a C constant, with the following extensions:
68.Pp 68.Pp
69.Bl -bullet -offset indent -compact 69.Bl -bullet -offset indent -compact
70.It 70.It
71A leading plus or minus sign is allowed. 71A leading plus or minus sign is allowed.
72.It 72.It
73If the leading character is a single or double quote, the value is the 73If the leading character is a single or double quote, the value is the
74.Tn ASCII 74.Tn ASCII
75code of the next character. 75code of the next character.
76.El 76.El
77.Pp 77.Pp
78The format string is reused as often as necessary to satisfy the 78The format string is reused as often as necessary to satisfy the
79.Ar arguments . 79.Ar arguments .
80Any extra format specifications are evaluated with zero or the null 80Any extra format specifications are evaluated with zero or the null
81string. 81string.
82.Pp 82.Pp
83Character escape sequences are in backslash notation as defined in 83Character escape sequences are in backslash notation as defined in
84.St -ansiC . 84.St -ansiC .
85The characters and their meanings are as follows: 85The characters and their meanings are as follows:
86.Bl -tag -width Ds -offset indent 86.Bl -tag -width Ds -offset indent
87.It Cm \ee 87.It Cm \ee
88Write an 88Write an
89.Aq escape 89.Aq escape
90character. 90character.
91.It Cm \ea 91.It Cm \ea
92Write a 92Write a
93.Aq bell 93.Aq bell
94character. 94character.
95.It Cm \eb 95.It Cm \eb
96Write a 96Write a
97.Aq backspace 97.Aq backspace
98character. 98character.
99.It Cm \ef 99.It Cm \ef
100Write a 100Write a
101.Aq form-feed 101.Aq form-feed
102character. 102character.
103.It Cm \en 103.It Cm \en
104Write a 104Write a
105.Aq new-line 105.Aq new-line
106character. 106character.
107.It Cm \er 107.It Cm \er
108Write a 108Write a
109.Aq carriage return 109.Aq carriage return
110character. 110character.
111.It Cm \et 111.It Cm \et
112Write a 112Write a
113.Aq tab 113.Aq tab
114character. 114character.
115.It Cm \ev 115.It Cm \ev
116Write a 116Write a
117.Aq vertical tab 117.Aq vertical tab
118character. 118character.
119.It Cm \e\' 119.It Cm \e\'
120Write a 120Write a
121.Aq single quote 121.Aq single quote
122character. 122character.
123.It Cm \e" 123.It Cm \e"
124Write a 124Write a
125.Aq double quote 125.Aq double quote
126character. 126character.
127.It Cm \e\e 127.It Cm \e\e
128Write a backslash character. 128Write a backslash character.
129.It Cm \e Ns Ar num 129.It Cm \e Ns Ar num
130Write an 8\-bit character whose 130Write an 8\-bit character whose
131.Tn ASCII 131.Tn ASCII
132value is the 1\-, 2\-, or 3\-digit octal number 132value is the 1\-, 2\-, or 3\-digit octal number
133.Ar num . 133.Ar num .
134.It Cm \ex Ns Ar xx 134.It Cm \ex Ns Ar xx
135Write an 8\-bit character whose 135Write an 8\-bit character whose
136.Tn ASCII 136.Tn ASCII
137value is the 1\- or 2\-digit hexadecimal number 137value is the 1\- or 2\-digit hexadecimal number
138.Ar xx . 138.Ar xx .
139.El 139.El
140.Pp 140.Pp
141Each format specification is introduced by the percent character 141Each format specification is introduced by the percent character
142.Pq Dq \&% . 142.Pq Dq \&% .
143The remainder of the format specification includes, 143The remainder of the format specification includes,
144in the following order: 144in the following order:
145.Bl -tag -width Ds 145.Bl -tag -width Ds
146.It Zero or more of the following flags : 146.It Zero or more of the following flags :
147.Bl -tag -width Ds 147.Bl -tag -width Ds
148.It Cm # 148.It Cm #
149A 149A
150.Sq # 150.Sq #
151character specifying that the value should be printed in an 151character specifying that the value should be printed in an
152.Dq alternative form . 152.Dq alternative form .
153For 153For
154.Cm b , 154.Cm b ,
155.Cm c , 155.Cm c ,
156.Cm d , 156.Cm d ,
157and 157and
158.Cm s 158.Cm s
159formats, this option has no effect. 159formats, this option has no effect.
160For the 160For the
161.Cm o 161.Cm o
162format the precision of the number is increased to force the first 162format the precision of the number is increased to force the first
163character of the output string to a zero. 163character of the output string to a zero.
164For the 164For the
165.Cm x 165.Cm x
166.Pq Cm X 166.Pq Cm X
167format, a non-zero result has the string 167format, a non-zero result has the string
168.Li 0x 168.Li 0x
169.Pq Li 0X 169.Pq Li 0X
170prepended to it. 170prepended to it.
171For 171For
172.Cm e , 172.Cm e ,
173.Cm E , 173.Cm E ,
174.Cm f , 174.Cm f ,
175.Cm g , 175.Cm g ,
176and 176and
177.Cm G 177.Cm G
178formats, the result will always contain a decimal point, even if no 178formats, the result will always contain a decimal point, even if no
179digits follow the point (normally, a decimal point only appears in the 179digits follow the point (normally, a decimal point only appears in the
180results of those formats if a digit follows the decimal point). 180results of those formats if a digit follows the decimal point).
181For 181For
182.Cm g 182.Cm g
183and 183and
184.Cm G 184.Cm G
185formats, trailing zeros are not removed from the result as they 185formats, trailing zeros are not removed from the result as they
186would otherwise be. 186would otherwise be.
187.\" I turned this off - decided it isn't a valid use of '#' 187.\" I turned this off - decided it isn't a valid use of '#'
188.\" For the 188.\" For the
189.\" .Cm B 189.\" .Cm B
190.\" format, backslash-escape sequences are expanded first; 190.\" format, backslash-escape sequences are expanded first;
191.It Cm \&\- 191.It Cm \&\-
192A minus sign 192A minus sign
193.Sq \- 193.Sq \-
194which specifies 194which specifies
195.Em left adjustment 195.Em left adjustment
196of the output in the indicated field; 196of the output in the indicated field;
197.It Cm \&+ 197.It Cm \&+
198A 198A
199.Sq \&+ 199.Sq \&+
200character specifying that there should always be 200character specifying that there should always be
201a sign placed before the number when using signed formats. 201a sign placed before the number when using signed formats.
202.It Sq \&\ \& 202.It Sq \&\ \&
203A space specifying that a blank should be left before a positive number 203A space specifying that a blank should be left before a positive number
204for a signed format. 204for a signed format.
205A 205A
206.Sq \&+ 206.Sq \&+
207overrides a space if both are used; 207overrides a space if both are used;
208.It Cm \&0 208.It Cm \&0
209A zero `0' character indicating that zero-padding should be used 209A zero `0' character indicating that zero-padding should be used
210rather than blank-padding. 210rather than blank-padding.
211A 211A
212.Sq \- 212.Sq \-
213overrides a 213overrides a
214.Sq \&0 214.Sq \&0
215if both are used; 215if both are used;
216.El 216.El
217.It Field Width : 217.It Field Width :
218An optional digit string specifying a 218An optional digit string specifying a
219.Em field width ; 219.Em field width ;
220if the output string has fewer characters than the field width it will 220if the output string has fewer characters than the field width it will
221be blank-padded on the left (or right, if the left-adjustment indicator 221be blank-padded on the left (or right, if the left-adjustment indicator
222has been given) to make up the field width (note that a leading zero 222has been given) to make up the field width (note that a leading zero
223is a flag, but an embedded zero is part of a field width); 223is a flag, but an embedded zero is part of a field width);
224.It Precision : 224.It Precision :
225An optional period, 225An optional period,
226.Sq Cm \&. , 226.Sq Cm \&. ,
227followed by an optional digit string giving a 227followed by an optional digit string giving a
228.Em precision 228.Em precision
229which specifies the number of digits to appear after the decimal point, 229which specifies the number of digits to appear after the decimal point,
230for 230for
231.Cm e 231.Cm e
232and 232and
233.Cm f 233.Cm f
234formats, or the maximum number of characters to be printed 234formats, or the maximum number of characters to be printed
235from a string 235from a string
236.Sm off 236.Sm off
237.Pf ( Cm b , 237.Pf ( Cm b ,
238.Sm on 238.Sm on
239.Cm B , 239.Cm B ,
240and 240and
241.Cm s 241.Cm s
242formats); if the digit string is missing, the precision is treated 242formats); if the digit string is missing, the precision is treated
243as zero; 243as zero;
244.It Format : 244.It Format :
245A character which indicates the type of format to use (one of 245A character which indicates the type of format to use (one of
246.Cm diouxXfwEgGbBcs ) . 246.Cm diouxXfwEgGbBcs ) .
247.El 247.El
248.Pp 248.Pp
249A field width or precision may be 249A field width or precision may be
250.Sq Cm \&* 250.Sq Cm \&*
251instead of a digit string. 251instead of a digit string.
252In this case an 252In this case an
253.Ar argument 253.Ar argument
254supplies the field width or precision. 254supplies the field width or precision.
255.Pp 255.Pp
256The format characters and their meanings are: 256The format characters and their meanings are:
257.Bl -tag -width Fl 257.Bl -tag -width Fl
258.It Cm diouXx 258.It Cm diouXx
259The 259The
260.Ar argument 260.Ar argument
261is printed as a signed decimal (d or i), unsigned octal, unsigned decimal, 261is printed as a signed decimal (d or i), unsigned octal, unsigned decimal,
262or unsigned hexadecimal (X or x), respectively. 262or unsigned hexadecimal (X or x), respectively.
263.It Cm f 263.It Cm f
264The 264The
265.Ar argument 265.Ar argument
266is printed in the style 266is printed in the style
267.Sm off 267.Sm off
268.Pf [\-]ddd Cm \&. No ddd 268.Pf [\-]ddd Cm \&. No ddd
269.Sm on 269.Sm on
270where the number of d's 270where the number of d's
271after the decimal point is equal to the precision specification for 271after the decimal point is equal to the precision specification for
272the argument. 272the argument.
273If the precision is missing, 6 digits are given; if the precision 273If the precision is missing, 6 digits are given; if the precision
274is explicitly 0, no digits and no decimal point are printed. 274is explicitly 0, no digits and no decimal point are printed.
275.It Cm eE 275.It Cm eE
276The 276The
277.Ar argument 277.Ar argument
278is printed in the style 278is printed in the style
279.Sm off 279.Sm off
280.Pf [\-]d Cm \&. No ddd Cm e No \*(Pmdd 280.Pf [\-]d Cm \&. No ddd Cm e No \*(Pmdd
281.Sm on 281.Sm on
282where there 282where there
283is one digit before the decimal point and the number after is equal to 283is one digit before the decimal point and the number after is equal to
284the precision specification for the argument; when the precision is 284the precision specification for the argument; when the precision is
285missing, 6 digits are produced. 285missing, 6 digits are produced.
286An upper-case E is used for an 286An upper-case E is used for an
287.Sq E 287.Sq E
288format. 288format.
289.It Cm gG 289.It Cm gG
290The 290The
291.Ar argument 291.Ar argument
292is printed in style 292is printed in style
293.Cm f 293.Cm f
294or in style 294or in style
295.Cm e 295.Cm e
296.Pq Cm E 296.Pq Cm E
297whichever gives full precision in minimum space. 297whichever gives full precision in minimum space.
298.It Cm b 298.It Cm b
299Characters from the string 299Characters from the string
300.Ar argument 300.Ar argument
301are printed with backslash-escape sequences expanded. 301are printed with backslash-escape sequences expanded.
302.Pp 302.Pp
303The following additional backslash-escape sequences are supported: 303The following additional backslash-escape sequences are supported:
304.Bl -tag -width Ds 304.Bl -tag -width Ds
305.It Cm \ec 305.It Cm \ec
306Causes 306Causes
307.Nm 307.Nm
308to ignore any remaining characters in the string operand containing it, 308to ignore any remaining characters in the string operand containing it,
309any remaining string operands, and any additional characters in 309any remaining string operands, and any additional characters in
310the format operand. 310the format operand.
311.It Cm \e0 Ns Ar num 311.It Cm \e0 Ns Ar num
312Write an 8\-bit character whose 312Write an 8\-bit character whose
313.Tn ASCII 313.Tn ASCII
314value is the 1\-, 2\-, or 3\-digit 314value is the 1\-, 2\-, or 3\-digit
315octal number 315octal number
316.Ar num . 316.Ar num .
317.It Cm \e^ Ns Ar c 317.It Cm \e^ Ns Ar c
318Write the control character 318Write the control character
319.Ar c . 319.Ar c .
320Generates characters `\e000' through `\e037`, and `\e177' (from `\e^?'). 320Generates characters `\e000' through `\e037`, and `\e177' (from `\e^?').
321.It Cm \eM\- Ns Ar c 321.It Cm \eM\- Ns Ar c
322Write the character 322Write the character
323.Ar c 323.Ar c
324with the 8th bit set. 324with the 8th bit set.
325Generates characters `\e241' through `\e376`. 325Generates characters `\e241' through `\e376`.
326.It Cm \eM^ Ns Ar c 326.It Cm \eM^ Ns Ar c
327Write the control character 327Write the control character
328.Ar c 328.Ar c
329with the 8th bit set. 329with the 8th bit set.
330Generates characters `\e200' through `\e237`, and `\e377' (from `\eM^?'). 330Generates characters `\e200' through `\e237`, and `\e377' (from `\eM^?').
331.El 331.El
332.It Cm B 332.It Cm B
333Characters from the string 333Characters from the string
334.Ar argument 334.Ar argument
335are printed with unprintable characters backslash-escaped using the 335are printed with unprintable characters backslash-escaped using the
336.Sm off 336.Sm off
337.Pf ` Cm \e Ar c No ', 337.Pf ` Cm \e Ar c No ',
338.Pf ` Cm \e^ Ar c No ', 338.Pf ` Cm \e^ Ar c No ',
339.Pf ` Cm \eM\- Ar c No ' 339.Pf ` Cm \eM\- Ar c No '
340or 340or
341.Pf ` Cm \eM^ Ar c No ', 341.Pf ` Cm \eM^ Ar c No ',
342.Sm on 342.Sm on
343formats described above. 343formats described above.
344.It Cm c 344.It Cm c
345The first character of 345The first character of
346.Ar argument 346.Ar argument
347is printed. 347is printed.
348.It Cm s 348.It Cm s
349Characters from the string 349Characters from the string
350.Ar argument 350.Ar argument
351are printed until the end is reached or until the number of characters 351are printed until the end is reached or until the number of characters
352indicated by the precision specification is reached; if the 352indicated by the precision specification is reached; if the
353precision is omitted, all characters in the string are printed. 353precision is omitted, all characters in the string are printed.
354.It Cm \&% 354.It Cm \&%
355Print a `%'; no argument is used. 355Print a `%'; no argument is used.
356.El 356.El
357.Pp 357.Pp
358In no case does a non-existent or small field width cause truncation of 358In no case does a non-existent or small field width cause truncation of
359a field; padding takes place only if the specified field width exceeds 359a field; padding takes place only if the specified field width exceeds
360the actual width. 360the actual width.
 361.Pp
 362If the first character of
 363.Ar format
 364is a dash,
 365.Ar format
 366must be preceded by a word consisting of two dashes (--) to prevent it
 367from being interpreted as an option string.
361.Sh EXIT STATUS 368.Sh EXIT STATUS
362.Ex -std 369.Ex -std
363.Sh SEE ALSO 370.Sh SEE ALSO
364.Xr echo 1 , 371.Xr echo 1 ,
365.Xr printf 3 , 372.Xr printf 3 ,
366.Xr vis 3 , 373.Xr vis 3 ,
367.Xr printf 9 374.Xr printf 9
368.Sh STANDARDS 375.Sh STANDARDS
369The 376The
370.Nm 377.Nm
371utility conforms to 378utility conforms to
372.St -p1003.1-2001 . 379.St -p1003.1-2001 .
373.Pp 380.Pp
374Support for the floating point formats and `*' as a field width and precision 381Support for the floating point formats and `*' as a field width and precision
375are optional in POSIX. 382are optional in POSIX.
376.Pp 383.Pp
377The behaviour of the %B format and the \e', \e", \exxx, \ee and 384The behaviour of the %B format and the \e', \e", \exxx, \ee and
378\e[M][\-|^]c escape sequences are undefined in POSIX. 385\e[M][\-|^]c escape sequences are undefined in POSIX.
379.Sh BUGS 386.Sh BUGS
380Since the floating point numbers are translated from 387Since the floating point numbers are translated from
381.Tn ASCII 388.Tn ASCII
382to floating-point and 389to floating-point and
383then back again, floating-point precision may be lost. 390then back again, floating-point precision may be lost.
384.Pp 391.Pp
385Hexadecimal character constants are restricted to, and should be specified 392Hexadecimal character constants are restricted to, and should be specified
386as, two character constants. 393as, two character constants.
387This is contrary to the ISO C standard but 394This is contrary to the ISO C standard but
388does guarantee detection of the end of the constant. 395does guarantee detection of the end of the constant.
389.Sh NOTES 396.Sh NOTES
390All formats which treat the 397All formats which treat the
391.Ar argument 398.Ar argument
392as a number first convert the 399as a number first convert the
393.Ar argument 400.Ar argument
394from its external representation as a character string 401from its external representation as a character string
395to an internal numeric representation, and then apply the 402to an internal numeric representation, and then apply the
396format to the internal numeric representation, producing 403format to the internal numeric representation, producing
397another external character string representation. 404another external character string representation.
398One might expect the 405One might expect the
399.Cm \&%c 406.Cm \&%c
400format to do likewise, but in fact it does not. 407format to do likewise, but in fact it does not.
401.Pp 408.Pp
402To convert a string representation of a decimal, octal, or hexadecimal 409To convert a string representation of a decimal, octal, or hexadecimal
403number into the corresponding character, two nested 410number into the corresponding character, two nested
404.Nm 411.Nm
405invocations may be used, in which the inner invocation 412invocations may be used, in which the inner invocation
406converts the input to an octal string, and the outer 413converts the input to an octal string, and the outer
407invocation uses the octal string as part of a format. 414invocation uses the octal string as part of a format.
408For example, the following command outputs the character whose code 415For example, the following command outputs the character whose code
409is 0x0A, which is a newline in ASCII: 416is 0x0A, which is a newline in ASCII:
410.Pp 417.Pp
411.Dl printf \&"$(printf \&"\e\e%o" \&"0x0A")" 418.Dl printf \&"$(printf \&"\e\e%o" \&"0x0A")"