Deleted Added
full compact
printf.1 (221013) printf.1 (221026)
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

--- 15 unchanged lines hidden (view full) ---

24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" @(#)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

--- 15 unchanged lines hidden (view full) ---

24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" @(#)printf.1 8.1 (Berkeley) 6/6/93
32.\" $FreeBSD: head/usr.bin/printf/printf.1 221013 2011-04-25 12:36:29Z jilles $
32.\" $FreeBSD: head/usr.bin/printf/printf.1 221026 2011-04-25 19:15:58Z jilles $
33.\"
34.Dd April 25, 2011
35.Dt PRINTF 1
36.Os
37.Sh NAME
38.Nm printf
39.Nd formatted output
40.Sh SYNOPSIS

--- 291 unchanged lines hidden (view full) ---

332.Sh HISTORY
333The
334.Nm
335command appeared in
336.Bx 4.3 Reno .
337It is modeled
338after the standard library function,
339.Xr printf 3 .
33.\"
34.Dd April 25, 2011
35.Dt PRINTF 1
36.Os
37.Sh NAME
38.Nm printf
39.Nd formatted output
40.Sh SYNOPSIS

--- 291 unchanged lines hidden (view full) ---

332.Sh HISTORY
333The
334.Nm
335command appeared in
336.Bx 4.3 Reno .
337It is modeled
338after the standard library function,
339.Xr printf 3 .
340.Sh CAVEATS
341.Tn ANSI
342hexadecimal character constants were deliberately not provided.
343.Pp
344Trying to print a dash ("-") as the first character causes
345.Nm
346to interpret the dash as a program argument.
347.Nm --
348must be used before
349.Ar format .
340.Sh BUGS
341Since the floating point numbers are translated from
342.Tn ASCII
343to floating-point and
344then back again, floating-point precision may be lost.
345(By default, the number is translated to an IEEE-754 double-precision
346value before being printed.
347The
348.Cm L
349modifier may produce additional precision, depending on the hardware platform.)
350.Pp
350.Sh BUGS
351Since the floating point numbers are translated from
352.Tn ASCII
353to floating-point and
354then back again, floating-point precision may be lost.
355(By default, the number is translated to an IEEE-754 double-precision
356value before being printed.
357The
358.Cm L
359modifier may produce additional precision, depending on the hardware platform.)
360.Pp
351.Tn ANSI
352hexadecimal character constants were deliberately not provided.
353.Pp
354The escape sequence \e000 is the string terminator.
355When present in the argument for the
356.Cm b
357format, the argument will be truncated at the \e000 character.
358.Pp
359Multibyte characters are not recognized in format strings (this is only
360a problem if
361.Ql %
362can appear inside a multibyte character).
361The escape sequence \e000 is the string terminator.
362When present in the argument for the
363.Cm b
364format, the argument will be truncated at the \e000 character.
365.Pp
366Multibyte characters are not recognized in format strings (this is only
367a problem if
368.Ql %
369can appear inside a multibyte character).
363.Pp
364Trying to print a dash ("-") as the first character causes
365.Nm
366to interpet the dash as a program argument.
367.Nm --
368must be used before
369.Ar format .