diff --git a/doc_src/printf.txt b/doc_src/printf.txt index 6c3ed558d..81082a264 100644 --- a/doc_src/printf.txt +++ b/doc_src/printf.txt @@ -6,11 +6,11 @@ printf format [argument...] \endfish \subsection printf-description Description -A front end to the printf function that lets it be used from the shell. +printf formats the string FORMAT with ARGUMENT, and displays the result. -This tool reads a format string, and then outputs the arguments according to that format. +The string FORMAT should contain format specifiers, each of which are replaced with successive arguments according to the specifier. Specifiers are detailed below, and are taken from the C library function `printf(3)`. -Unlike `echo`, however, it does not append a newline unless explicitly directed to. +Unlike `echo`, `printf` does not append a new line unless it is specified as part of the string. Valid format specifiers are: @@ -53,9 +53,9 @@ printf also knows a number of backslash escapes: - `\uhhhh` 16-bit Unicode character (hhhh is 4 digits) - `\Uhhhhhhhh` 32-bit Unicode character (hhhhhhhh is 8 digits) -The `format' argument is re-used as many times as necessary to convert all of the given arguments. +The `format' argument is re-used as many times as necessary to convert all of the given arguments. If a format specifier is not appropriate for the given argument, an error is printed. For example, `printf '%d' "102.234"` produces an error, as "102.234" cannot be formatted as an integer. -This file has been imported from source code of printf command in GNU Coreutils version 6.9. If you would like to use a newer version of printf, for example the one shipped with your OS, try `command printf`. +This file has been imported from the printf in GNU Coreutils version 6.9. If you would like to use a newer version of printf, for example the one shipped with your OS, try `command printf`. \subsection printf-example Example