aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/printf.txt
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-11 11:23:27 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-11 11:33:04 +0200
commitb8d9ba993dbb3bccabfcdd10e754b6a5832546d7 (patch)
treed24ab400506c1a4a9e0ac2e8af0af9acd30968d9 /doc_src/printf.txt
parent3810ef47f7d66f9b34fb0fa003579d86ed41d3ee (diff)
printf docs: Improve wording
Diffstat (limited to 'doc_src/printf.txt')
-rw-r--r--doc_src/printf.txt10
1 files changed, 5 insertions, 5 deletions
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