aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/printf/printf.1
Commit message (Collapse)AuthorAgeFilesLines
* Add parameterized position handling to printf(1).Pedro F. Giffuni2014-04-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=264743
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* printf(1): Document that %c and precision for %b/%s use bytes, not chars.Jilles Tjoelker2011-05-281-6/+17
| | | | | | | | | | 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. Notes: svn path=/head/; revision=222421
* printf: Allow multibyte characters for '<char> form, avoid negative codes.Jilles Tjoelker2011-05-281-3/+2
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=222418
* printf(1): Move non-bugs from the BUGS section to a new section CAVEATS.Jilles Tjoelker2011-04-251-10/+10
| | | | Notes: svn path=/head/; revision=221026
* printf(1): Mention effect of '#' modifier on other conversions.Jilles Tjoelker2011-04-251-5/+5
| | | | Notes: svn path=/head/; revision=221013
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=216370
* sh: Add printf builtin.Jilles Tjoelker2010-11-191-1/+10
| | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=215520
* Note bug in trying to printf(1) things like: '-%s\n' "foo"David E. O'Brien2010-09-091-0/+7
| | | | Notes: svn path=/head/; revision=212374
* printf(1): Clarify that \OOO produces a byte, different %b escape sequences.Jilles Tjoelker2010-09-051-4/+10
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=212244
* Markup and wording fixes.Ruslan Ermilov2005-06-141-1/+1
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=147370
* Update the bugs section, null characters in the format string are now handled.Stefan Farfeleder2005-04-141-6/+4
| | | | Notes: svn path=/head/; revision=145084
* Support the L modifier for floating-point values as an extension.David Schultz2005-03-211-0/+10
| | | | | | | | | 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. Notes: svn path=/head/; revision=143906
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Fix a markup nit and a misplaced full stop in previous.Tim J. Robbins2004-07-031-2/+2
| | | | | | | Noticed by: ru Notes: svn path=/head/; revision=131519
* Document missing multibyte character support in utilities specifiedTim J. Robbins2004-07-031-1/+6
| | | | | | | by POSIX. Notes: svn path=/head/; revision=131511
* Deal with double whitespace.Ruslan Ermilov2004-07-031-4/+4
| | | | Notes: svn path=/head/; revision=131507
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-7/+14
| | | | Notes: svn path=/head/; revision=131491
* s/latter/former/David Schultz2004-06-051-1/+1
| | | | Notes: svn path=/head/; revision=130117
* - Document the %a, %A, and %F format specifiers.David Schultz2004-06-051-3/+31
| | | | | | | | - Document the way infinity and NaN are printed. - Un-document the non-existent %w specifier. Notes: svn path=/head/; revision=130116
* Kill excessive whitespace between macro arguments.Giorgos Keramidas2002-07-151-5/+5
| | | | Notes: svn path=/head/; revision=100045
* Typo: characer -> characterGiorgos Keramidas2002-05-311-1/+1
| | | | Notes: svn path=/head/; revision=97643
* mdoc(7) police: lint.Ruslan Ermilov2002-05-301-10/+8
| | | | Notes: svn path=/head/; revision=97541
* - printf shouldn't bail out if a conversion fails, it should just keepJuli Mallett2002-04-231-5/+27
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=95300
* Use `The .Nm utility'Philippe Charnier2002-04-201-2/+3
| | | | Notes: svn path=/head/; revision=95124
* Replace reference to ANSI C draft with standard.Ruslan Ermilov2002-01-161-4/+1
| | | | | | | PR: docs/30731 Notes: svn path=/head/; revision=89426
* The RETURN VALUES section is not appropriate for section 1 manualDima Dorfman2001-11-231-3/+2
| | | | | | | | pages; rename it to DIAGNOSTICS. Also use the .Ex macro while I'm here. Notes: svn path=/head/; revision=86824
* Remove the printf builtin command from sh(1), which command is notAkinori MUSHA2001-11-201-10/+0
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=86692
* Remove whitespace at EOL.Dima Dorfman2001-07-151-3/+3
| | | | Notes: svn path=/head/; revision=79755
* mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).Ruslan Ermilov2001-07-061-2/+2
| | | | Notes: svn path=/head/; revision=79366
* mdoc(7) police: mark LC_NUMERIC with .Dv.Ruslan Ermilov2001-02-101-1/+2
| | | | Notes: svn path=/head/; revision=72313
* Localize it (LC_NUMERIC)Andrey A. Chernov2001-02-101-0/+3
| | | | Notes: svn path=/head/; revision=72304
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-191-2/+5
| | | | Notes: svn path=/head/; revision=70197
* Revert to 1.8. I misread the sentence and its context.Chris Costello2000-07-211-2/+1
| | | | Notes: svn path=/head/; revision=63734
* Properly document %.0f behavior.Chris Costello2000-07-211-1/+2
| | | | Notes: svn path=/head/; revision=63733
* Document truncation of strings when a NUL character is reached in a formatChris Costello2000-01-191-0/+6
| | | | | | | | | | string. PR: 15929 Submitted by: Daniel Hagan <dhagan@cs.vt.edu> Notes: svn path=/head/; revision=56264
* Correct some hard sentence breaks. Only those surrounding the previousSheldon Hearn1999-09-141-2/+2
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=51275
* Improve shell documentation:Sheldon Hearn1999-09-081-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 Notes: svn path=/head/; revision=51090
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=48792
* Correct Synopsys section.Philippe Charnier1997-08-041-3/+3
| | | | Notes: svn path=/head/; revision=27887
* Correctly match the format flags and their descriptions.Mike Pritchard1996-04-091-1/+1
| | | | | | | Submitted by: Dave Glowacki <dglo@ssec.wisc.edu> Notes: svn path=/head/; revision=15163
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+272
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590