GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
printf(1) User Commands printf(1)

printf - write formatted output

printf format [argument]... 

The printf command writes formatted operands to the standard output. The argument operands are formatted under control of the format operand. The format operand is treated like a printf(3) format string and the escape sequences '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\' and '\ddd', where ddd is one to three octal digits, are expanded as if they were in a C string.

In addition to the format specifiers %c, %s, %d, %i, %o, %u, %x, %X, %e, %E, %f, %F, %g, %G, the format %b is supported. The integers are handled internally as intmax_t to avoid range problems even though only the standard int type specifiers are supported in the format operand. The format %b is treated like %s except that escape sequences in the argument string are expanded as with the echo command.

Field width and precision may be specified either numerically in the format operand or via the '*' format specifier and related arguments.

The printf(3) flag characters '+', ' ', '#' and '0' are supported.

The format strings %n$ and *m$, where n or m are decimal integers in the range 1 .. maxargs, allow one to specify the position in the parameter list. See printf(3) for more information.

The format operand is reused as often as necessary to satisfy the argument operands. If the format operand contains more format specifiers than argument operands have been specified, string formats are treated as if an empty string has been supplied and integer arguments are treated as if a 0 has been supplied.

The following exit values are returned:

0
Successful completion.
>0
An error occurred.

bosh(1), printf(3).

None currently known.

Mail bugs and suggestions to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues.

The mailing list archive may be found at:

https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists.in-berlin.de.

Joerg Schilling wrote printf in 2015 - 2017. It is now maintained by the schilytools project authors.

The source code for printf is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at

https://codeberg.org/schilytools/schilytools.

The download directory is

https://codeberg.org/schilytools/schilytools/releases.

2022/08/20 Joerg Schilling

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.