History log of /freebsd-current/usr.bin/printf/printf.1
Revision Date Author Comments
# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# b2c76c41 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line nroff pattern

Remove /^\.\\"\s*\$FreeBSD\$$\n/


# 5dbd4b8e 01-Jul-2020 Fernando ApesteguĂ­a <fernape@FreeBSD.org>

printf(1): Add EXAMPLES section

* Small addition with four simple examples
* While here, remove three obsolete .Tn macros

Approved by: manpages (gbe)
Differential Revision: https://reviews.freebsd.org/D25462


# 2bf7d924 29-Jul-2019 Jilles Tjoelker <jilles@FreeBSD.org>

printf(1): Note that \c only works in %b strings

PR: 238313
Reported by: Andras Farkas
MFC after: 1 week


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# b0620803 21-Apr-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

Add parameterized position handling to printf(1).

Add a new %n$ option to change the order of the parameters as
done in the ksh93 builtin printf (among others).

For example:
%printf '%2$1d %1$s\n' one 2 three 4
2 one
4 three

The feature was written by Garret D'Amore under a
BSD license for Nexenta/illumos.

Reference:
http://garrett.damore.org/2010/10/new-implementation-of-printf.html

PR: bin/152934
Obtained from: Illumos
MFC after: 2 weeks


# 50d675f7 28-Mar-2012 Eitan Adler <eadler@FreeBSD.org>

Remove trailing whitespace per mdoc lint warning

Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days


# 27a43b2e 28-May-2011 Jilles Tjoelker <jilles@FreeBSD.org>

printf(1): Document that %c and precision for %b/%s use bytes, not chars.

This means these features do not work as expected with multibyte characters.

This perhaps less than ideal behaviour matches printf(3) and is specified by
POSIX.


# 98102dab 28-May-2011 Jilles Tjoelker <jilles@FreeBSD.org>

printf: Allow multibyte characters for '<char> form, avoid negative codes.

Examples:
LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.


# 1792d820 25-Apr-2011 Jilles Tjoelker <jilles@FreeBSD.org>

printf(1): Move non-bugs from the BUGS section to a new section CAVEATS.


# 8a906b23 24-Apr-2011 Jilles Tjoelker <jilles@FreeBSD.org>

printf(1): Mention effect of '#' modifier on other conversions.


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 9897c45f 18-Nov-2010 Jilles Tjoelker <jilles@FreeBSD.org>

sh: Add printf builtin.

This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
printf(1) at all.
* In many other shells printf is already a builtin.

Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).

Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 4b2f9153 09-Sep-2010 David E. O'Brien <obrien@FreeBSD.org>

Note bug in trying to printf(1) things like: '-%s\n' "foo"


# 3cf53e85 05-Sep-2010 Jilles Tjoelker <jilles@FreeBSD.org>

printf(1): Clarify that \OOO produces a byte, different %b escape sequences.

Octal escape sequences are expanded to bytes, not characters, and multiple
are required for a multibyte character.

The valid escape sequences in %b strings are slightly different from the
escape sequences in the format string.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 39c59153 14-Jun-2005 Ruslan Ermilov <ru@FreeBSD.org>

Markup and wording fixes.

Approved by: re (blanket)


# e897c4d6 14-Apr-2005 Stefan Farfeleder <stefanf@FreeBSD.org>

Update the bugs section, null characters in the format string are now handled.


# fd757c50 21-Mar-2005 David Schultz <das@FreeBSD.org>

Support the L modifier for floating-point values as an extension.
When L is omitted, double precision is used, so printf(1) gives
reproducable results. When L is specified, long double precision is
used, which may improve precision, depending on the machine.


# a866e170 17-Jan-2005 Ruslan Ermilov <ru@FreeBSD.org>

Added the EXIT STATUS section where appropriate.


# 2e94ae7e 03-Jul-2004 Tim J. Robbins <tjr@FreeBSD.org>

Fix a markup nit and a misplaced full stop in previous.

Noticed by: ru


# 4f45d811 02-Jul-2004 Tim J. Robbins <tjr@FreeBSD.org>

Document missing multibyte character support in utilities specified
by POSIX.


# 557b7fa1 02-Jul-2004 Ruslan Ermilov <ru@FreeBSD.org>

Deal with double whitespace.


# 6a3e8b0a 02-Jul-2004 Ruslan Ermilov <ru@FreeBSD.org>

Mechanically kill hard sentence breaks.


# 939e953e 05-Jun-2004 David Schultz <das@FreeBSD.org>

s/latter/former/


# 08cdb7cd 05-Jun-2004 David Schultz <das@FreeBSD.org>

- Document the %a, %A, and %F format specifiers.
- Document the way infinity and NaN are printed.
- Un-document the non-existent %w specifier.


# b4e16434 15-Jul-2002 Giorgos Keramidas <keramida@FreeBSD.org>

Kill excessive whitespace between macro arguments.


# 806968d6 30-May-2002 Giorgos Keramidas <keramida@FreeBSD.org>

Typo: characer -> character


# 3a0f91d5 29-May-2002 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: lint.


# ab5a295b 22-Apr-2002 Juli Mallett <jmallett@FreeBSD.org>

- printf shouldn't bail out if a conversion fails, it should just keep
processing them.
- \c escape to immediately stop output (similar to echo's \c)
- \0NNN should be allowed for octal character escapes (instead of just \NNN)
- %b conversion, which is like %s but interprets \n \t etc. inside the
string is missing.

And I may not be any poet, but in lieu of an in-tree regression test:
ref5% ./printf '%s%b%b%c%s%d\n' 'PR' '\0072' '\t' '3' '56' 0x10
PR: 35616

Submitted by: tjr
MFC after: 1 week


# e8937ba0 19-Apr-2002 Philippe Charnier <charnier@FreeBSD.org>

Use `The .Nm utility'


# 3e4f59ce 16-Jan-2002 Ruslan Ermilov <ru@FreeBSD.org>

Replace reference to ANSI C draft with standard.

PR: docs/30731


# c24ca63d 23-Nov-2001 Dima Dorfman <dd@FreeBSD.org>

The RETURN VALUES section is not appropriate for section 1 manual
pages; rename it to DIAGNOSTICS. Also use the .Ex macro while I'm
here.


# 018d9f62 20-Nov-2001 Akinori MUSHA <knu@FreeBSD.org>

Remove the printf builtin command from sh(1), which command is not
used so often that it's worth keeping it as a builtin.

Now that all the printf invocations from within the system startup
scripts, we can safely remove it.

Urged by: sheldonh :)

No MFC is planned so far because it may break compatibility and
violate POLA.


# f247324d 15-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Remove whitespace at EOL.


# 5521ff5a 06-Jul-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).


# 429d919c 10-Feb-2001 Ruslan Ermilov <ru@FreeBSD.org>

mdoc(7) police: mark LC_NUMERIC with .Dv.


# dc7d8c99 09-Feb-2001 Andrey A. Chernov <ache@FreeBSD.org>

Localize it (LC_NUMERIC)


# 9b88faec 19-Dec-2000 Ruslan Ermilov <ru@FreeBSD.org>

Prepare for mdoc(7)NG.


# 49776176 21-Jul-2000 Chris Costello <chris@FreeBSD.org>

Revert to 1.8. I misread the sentence and its context.


# c4619be2 21-Jul-2000 Chris Costello <chris@FreeBSD.org>

Properly document %.0f behavior.


# 1ead4519 18-Jan-2000 Chris Costello <chris@FreeBSD.org>

Document truncation of strings when a NUL character is reached in a format
string.

PR: 15929
Submitted by: Daniel Hagan <dhagan@cs.vt.edu>


# e6d3cf26 14-Sep-1999 Sheldon Hearn <sheldonh@FreeBSD.org>

Correct some hard sentence breaks. Only those surrounding the previous
commit and those which cause ugly nroff output have been fixed, since
the purpose of the style guideline which they contravene is to reduce
the sizes of deltas.

Reported by: bde


# c644db6a 08-Sep-1999 Sheldon Hearn <sheldonh@FreeBSD.org>

Improve shell documentation:

* Consistently misspell built-in as builtin.

* Add a builtin(1) manpage and create builtin(1) MLINKS for all shell
builtin commands for which no standalone utility exists. These MLINKS
replace those that were created for csh(1).

* Add appropriate xrefs for builtin(1) to the csh(1) and sh(1) manpages,
as well as to the manpages of standalone utilities which are supported
as shell builtin commands in at least one of the shells. In such
manpages, explain that similar functionality may be provided as a
shell builtin command.

* Improve sh(1)'s description of the cd builtin command. Csh(1) already
describes it adequately. Replace the cd(1) manpage with a builtin(1)
MLINKS link.

* Clean up some mdoc problems: use Xr instead of literal "foo(n)"; use
Ic instead of Xr for shell builtin commands.

* Undo English contractions.

Reviewed by: mpp, rgrimes


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 3be5f1f5 12-Jul-1999 Nik Clayton <nik@FreeBSD.org>

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


# 69d85135 04-Aug-1997 Philippe Charnier <charnier@FreeBSD.org>

Correct Synopsys section.


# 457788f8 09-Apr-1996 Mike Pritchard <mpp@FreeBSD.org>

Correctly match the format flags and their descriptions.

Submitted by: Dave Glowacki <dglo@ssec.wisc.edu>


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources