printf.1 (147370) | printf.1 (212244) |
---|---|
1.\" Copyright (c) 1989, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the Institute of Electrical and Electronics Engineers, Inc. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)printf.1 8.1 (Berkeley) 6/6/93 | 1.\" Copyright (c) 1989, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the Institute of Electrical and Electronics Engineers, Inc. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)printf.1 8.1 (Berkeley) 6/6/93 |
36.\" $FreeBSD: head/usr.bin/printf/printf.1 147370 2005-06-14 11:50:53Z ru $ | 36.\" $FreeBSD: head/usr.bin/printf/printf.1 212244 2010-09-05 21:44:50Z jilles $ |
37.\" | 37.\" |
38.Dd April 14, 2005 | 38.Dd September 5, 2010 |
39.Dt PRINTF 1 40.Os 41.Sh NAME 42.Nm printf 43.Nd formatted output 44.Sh SYNOPSIS 45.Nm 46.Ar format Op Ar arguments ... --- 57 unchanged lines hidden (view full) --- 104Write a <tab> character. 105.It Cm \ev 106Write a <vertical tab> character. 107.It Cm \e\' 108Write a <single quote> character. 109.It Cm \e\e 110Write a backslash character. 111.It Cm \e Ns Ar num | 39.Dt PRINTF 1 40.Os 41.Sh NAME 42.Nm printf 43.Nd formatted output 44.Sh SYNOPSIS 45.Nm 46.Ar format Op Ar arguments ... --- 57 unchanged lines hidden (view full) --- 104Write a <tab> character. 105.It Cm \ev 106Write a <vertical tab> character. 107.It Cm \e\' 108Write a <single quote> character. 109.It Cm \e\e 110Write a backslash character. 111.It Cm \e Ns Ar num |
112.It Cm \e0 Ns Ar num 113Write an 8-bit character whose 114.Tn ASCII | 112Write a byte whose |
115value is the 1-, 2-, or 3-digit 116octal number 117.Ar num . | 113value is the 1-, 2-, or 3-digit 114octal number 115.Ar num . |
116Multibyte characters can be constructed using multiple 117.Cm \e Ns Ar num 118sequences. |
|
118.El 119.Pp 120Each format specification is introduced by the percent character 121(``%''). 122The remainder of the format specification includes, 123in the following order: 124.Bl -tag -width Ds 125.It "Zero or more of the following flags:" --- 158 unchanged lines hidden (view full) --- 284are printed until the end is reached or until the number of characters 285indicated by the precision specification is reached; however if the 286precision is 0 or missing, all characters in the string are printed. 287.It Cm b 288As for 289.Cm s , 290but interpret character escapes in backslash notation in the string 291.Ar argument . | 119.El 120.Pp 121Each format specification is introduced by the percent character 122(``%''). 123The remainder of the format specification includes, 124in the following order: 125.Bl -tag -width Ds 126.It "Zero or more of the following flags:" --- 158 unchanged lines hidden (view full) --- 285are printed until the end is reached or until the number of characters 286indicated by the precision specification is reached; however if the 287precision is 0 or missing, all characters in the string are printed. 288.It Cm b 289As for 290.Cm s , 291but interpret character escapes in backslash notation in the string 292.Ar argument . |
293The permitted escape sequences are slightly different in that 294octal escapes are 295.Cm \e0 Ns Ar num 296instead of 297.Cm \e Ns Ar num . |
|
292.It Cm \&% 293Print a `%'; no argument is used. 294.El 295.Pp 296The decimal point 297character is defined in the program's locale (category 298.Dv LC_NUMERIC ) . 299.Pp --- 52 unchanged lines hidden --- | 298.It Cm \&% 299Print a `%'; no argument is used. 300.El 301.Pp 302The decimal point 303character is defined in the program's locale (category 304.Dv LC_NUMERIC ) . 305.Pp --- 52 unchanged lines hidden --- |