summaryrefslogtreecommitdiff
path: root/Doc/help/printf
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2020-02-16 03:29:19 +0100
committerAxel Beckert <abe@deuxchevaux.org>2020-02-16 03:29:19 +0100
commit2794556a41b50f635b6aa49c32fc6ca7bc08c901 (patch)
tree9557d7a073d4b24e9f10cdc337d9a819eb65ad1a /Doc/help/printf
parentb0d5cb56971618762ab13dbdb8fb17753f07f0f6 (diff)
parent94c033d2e281eb1f49e8366d21fc259ce8c0c4f5 (diff)
downloadzsh-2794556a41b50f635b6aa49c32fc6ca7bc08c901.tar.gz
zsh-2794556a41b50f635b6aa49c32fc6ca7bc08c901.zip
Update upstream source from tag 'upstream/5.8'
Update to upstream version '5.8' with Debian dir b7a9cb7b782a12a49dca06e06ca2554b5a95bf93
Diffstat (limited to 'Doc/help/printf')
-rw-r--r--Doc/help/printf35
1 files changed, 35 insertions, 0 deletions
diff --git a/Doc/help/printf b/Doc/help/printf
new file mode 100644
index 000000000..e18ca3ea4
--- /dev/null
+++ b/Doc/help/printf
@@ -0,0 +1,35 @@
+printf [ -v name ] format [ arg ... ]
+ Print the arguments according to the format specification. For-
+ matting rules are the same as used in C. The same escape se-
+ quences as for echo are recognised in the format. All C conver-
+ sion specifications ending in one of csdiouxXeEfgGn are handled.
+ In addition to this, `%b' can be used instead of `%s' to cause
+ escape sequences in the argument to be recognised and `%q' can
+ be used to quote the argument in such a way that allows it to be
+ reused as shell input. With the numeric format specifiers, if
+ the corresponding argument starts with a quote character, the
+ numeric value of the following character is used as the number
+ to print; otherwise the argument is evaluated as an arithmetic
+ expression. See the section `Arithmetic Evaluation' in zsh-
+ misc(1) for a description of arithmetic expressions. With `%n',
+ the corresponding argument is taken as an identifier which is
+ created as an integer parameter.
+
+ Normally, conversion specifications are applied to each argument
+ in order but they can explicitly specify the nth argument is to
+ be used by replacing `%' by `%n$' and `*' by `*n$'. It is rec-
+ ommended that you do not mix references of this explicit style
+ with the normal style and the handling of such mixed styles may
+ be subject to future change.
+
+ If arguments remain unused after formatting, the format string
+ is reused until all arguments have been consumed. With the print
+ builtin, this can be suppressed by using the -r option. If more
+ arguments are required by the format than have been specified,
+ the behaviour is as if zero or an empty string had been speci-
+ fied as the argument.
+
+ The -v option causes the output to be stored as the value of the
+ parameter name, instead of printed. If name is an array and the
+ format string is reused when consuming arguments then one array
+ element will be used for each use of the format string.