diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2001-10-08 10:47:46 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2001-10-08 10:47:46 +0000 |
commit | 648d1c275613f7e43d01278fb3ffb5bca34640e2 (patch) | |
tree | a1f9616537f0836eebca8157ea836e414a8dba74 /Doc/Zsh/builtins.yo | |
parent | 0ca8bb74f02b1291786f80d9e9f3f884f4ae0fa8 (diff) | |
download | zsh-648d1c275613f7e43d01278fb3ffb5bca34640e2.tar.gz zsh-648d1c275613f7e43d01278fb3ffb5bca34640e2.tar.xz zsh-648d1c275613f7e43d01278fb3ffb5bca34640e2.zip |
add print -f option, %n format specifier and tests for print/printf (15973)
Diffstat (limited to 'Doc/Zsh/builtins.yo')
-rw-r--r-- | Doc/Zsh/builtins.yo | 12 |
1 files changed, 9 insertions, 3 deletions
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 |