From 648d1c275613f7e43d01278fb3ffb5bca34640e2 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 8 Oct 2001 10:47:46 +0000 Subject: add print -f option, %n format specifier and tests for print/printf (15973) --- Doc/Zsh/builtins.yo | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Doc/Zsh/builtins.yo') diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index eceb3258b..8d23fc175 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -638,7 +638,8 @@ If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and `tt(-)' in this context are swapped. ) findex(print) -item(tt(print) [ tt(-bnrslzpNDPoOicm) ] [ tt(-u)var(n) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( +item(tt(print) [ tt(-bnrslzpNDPoOicm) ] [ tt(-u)var(n) ] [ tt(-f) var(format) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( +With the `tt(-f)' option the arguments are printed as described by tt(printf). With no flags or with flag `tt(-)', the arguments are printed on the standard output as described by tt(echo), with the following differences: the escape sequence `tt(\M-)var(x)' metafies the character @@ -715,19 +716,24 @@ ifnzman(noderef(Prompt Expansion))\ ). ) enditem() + +If any of `tt(-m)', `tt(-o)' or `tt(-O)' are used in combination with +`tt(-f)' and there are no arguments (after the removal process in the +case of `tt(-m)') then nothing is printed. ) 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 -csdiouxXeEfgG are handled. In addition to this, `tt(%b)' can be used +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, the numeric value of the following character is used as the number to -print. +print. With `tt(%n)', the corresponding argument is taken as an identifier +which is created as an integer parameter. If arguments remain unused after formatting, the format string is reused until all arguments have been consumed. If more arguments are required by -- cgit 1.4.1