| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
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 |
| @@ -22,27 +22,27 @@ | | | @@ -22,27 +22,27 @@ |
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 |
47 | formats and prints its arguments, after the first, under control | | 47 | formats and prints its arguments, after the first, under control |
48 | of the | | 48 | of the |
| @@ -348,26 +348,33 @@ is printed. | | | @@ -348,26 +348,33 @@ is printed. |
348 | .It Cm s | | 348 | .It Cm s |
349 | Characters from the string | | 349 | Characters from the string |
350 | .Ar argument | | 350 | .Ar argument |
351 | are printed until the end is reached or until the number of characters | | 351 | are printed until the end is reached or until the number of characters |
352 | indicated by the precision specification is reached; if the | | 352 | indicated by the precision specification is reached; if the |
353 | precision is omitted, all characters in the string are printed. | | 353 | precision is omitted, all characters in the string are printed. |
354 | .It Cm \&% | | 354 | .It Cm \&% |
355 | Print a `%'; no argument is used. | | 355 | Print a `%'; no argument is used. |
356 | .El | | 356 | .El |
357 | .Pp | | 357 | .Pp |
358 | In no case does a non-existent or small field width cause truncation of | | 358 | In no case does a non-existent or small field width cause truncation of |
359 | a field; padding takes place only if the specified field width exceeds | | 359 | a field; padding takes place only if the specified field width exceeds |
360 | the actual width. | | 360 | the actual width. |
| | | 361 | .Pp |
| | | 362 | If the first character of |
| | | 363 | .Ar format |
| | | 364 | is a dash, |
| | | 365 | .Ar format |
| | | 366 | must be preceded by a word consisting of two dashes (--) to prevent it |
| | | 367 | from 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 |
369 | The | | 376 | The |
370 | .Nm | | 377 | .Nm |
371 | utility conforms to | | 378 | utility conforms to |
372 | .St -p1003.1-2001 . | | 379 | .St -p1003.1-2001 . |
373 | .Pp | | 380 | .Pp |