From 62829b856d9c6b054f3c6338a20f9d5c04d79d42 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 18 Oct 2001 14:22:21 +0000 Subject: allow arguments to be specified in printf format specifications (16080) --- Doc/Zsh/builtins.yo | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Doc/Zsh/builtins.yo') diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 91df46c06..ef82f851e 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -725,9 +725,9 @@ findex(printf) item(tt(printf) var(format) [ var(arg) ... ])( Print the arguments according to the format specification. Formatting rules are the same as used in C. The same escape sequences as for tt(echo) -are recognised in the format. All C format specifications ending in one of -csdiouxXeEfgGn are handled. In addition to this, `tt(%b)' can be used -instead of `tt(%s)' to cause escape sequences in the argument to be +are recognised in the format. All C conversion specifications ending in +one of csdiouxXeEfgGn are handled. In addition to this, `tt(%b)' can be +used instead of `tt(%s)' to cause escape sequences in the argument to be recognised and `tt(%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, @@ -737,6 +737,13 @@ noderef(Arithmetic Evaluation) for a description of arithmetic expressions. With `tt(%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 var(n)th argument is to be used by +replacing `tt(%)' by `tt(%)var(n)tt($)' and `tt(*)' by `tt(*)var(n)tt($)'. +It is recommended 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. If more arguments are required by the format than have been specified, the behaviour is as if zero or an -- cgit 1.4.1