From b8d9ba993dbb3bccabfcdd10e754b6a5832546d7 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 11 Sep 2015 11:23:27 +0200 Subject: printf docs: Improve wording --- doc_src/printf.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc_src/printf.txt') diff --git a/doc_src/printf.txt b/doc_src/printf.txt index 6c3ed558..81082a26 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 -- cgit v1.2.3