PRINTF(1) General Commands Manual PRINTF(1)

printfwrite formatted output

printf format [argument ...]

The printf utility formats and writes its arguments, under control of the format, to the standard output. The format is a string composed of plain characters, character escape sequences, and conversion specifiers.

The following character escape sequences, which are in backslash notation, are supported:

A ⟨bell⟩ character.
A ⟨backspace⟩ character.
A ⟨form-feed⟩ character.
A ⟨new-line⟩ character.
A ⟨carriage return⟩ character.
A ⟨tabulation⟩ character.
A ⟨vertical tabulation⟩ character.
\\
A backslash character.
\num
A 8-bit character represented by a octal number.

The following conversion specifiers are supported:

Signed decimal.
Single character.
Unsigned octal.
Nil-terminated string.
Unsigned decimal.
Unsigned hexadecimal.
The percent (‘%’) character.

Along with the following flags:

The argument is converted to an alternative form.
-
The argument is left-justified within the field.
The argument is preceded by a sign.
‘ ’
The argument, when it is a positive number, is preceded by a blank character.
The argument will be zero-padded instead of blank-padded.

The printf utility exits 0 on success, and >0 if an error occurs.

echo(1)

The printf utility is compliant with the specification except from the “%b” conversion specifier.

December 29, 2019 EltaninOS