summary refs log tree commit diff
path: root/Doc/Zsh/expn.yo
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-06-05 11:15:48 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-06-05 11:15:48 +0000
commit72529e4fa606e9ccb6b9200df2d696782c742ac7 (patch)
tree09d617db5dcefefcaee65ef2c6f4ea38b99fa26c /Doc/Zsh/expn.yo
parent96eb8faa7c811b49d78f3772e327c502a972da5e (diff)
downloadzsh-72529e4fa606e9ccb6b9200df2d696782c742ac7.tar.gz
zsh-72529e4fa606e9ccb6b9200df2d696782c742ac7.tar.xz
zsh-72529e4fa606e9ccb6b9200df2d696782c742ac7.zip
27304: add ${(q-)..} flag
Diffstat (limited to 'Doc/Zsh/expn.yo')
-rw-r--r--Doc/Zsh/expn.yo24
1 files changed, 16 insertions, 8 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index bab12cc3f..59b6aeb87 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -825,14 +825,22 @@ have `tt(foo=bar)' and `tt(bar=baz)', the strings tt(${(P)foo}),
 tt(${(P)${foo}}), and tt(${(P)$(echo bar)}) will be expanded to `tt(baz)'.
 )
 item(tt(q))(
-Quote the resulting words with backslashes; unprintable or invalid
-characters are quoted using the tt($'\)var(NNN)tt(') form, with separate
-quotes for each octet.  If this flag is given
-twice, the resulting words are quoted in single quotes and if it is
-given three times, the words are quoted in double quotes; in these forms
-no special handling of unprintable or invalid characters is attempted.  If
-the flag is given four times, the words are quoted in single quotes
-preceded by a tt($).
+Quote characters that are special to the shell in the resulting words with
+backslashes; unprintable or invalid characters are quoted using the
+tt($'\)var(NNN)tt(') form, with separate quotes for each octet.
+
+If this flag is given twice, the resulting words are quoted in single
+quotes and if it is given three times, the words are quoted in double
+quotes; in these forms no special handling of unprintable or invalid
+characters is attempted.  If the flag is given four times, the words are
+quoted in single quotes preceded by a tt($).  Note that in all three of
+these forms quoting is done unconditionally, even if this does not change
+the way the resulting string would be interpreted by the shell.
+
+If a tt(q-) is given (only a single tt(q) may appear), a minimal
+form of single quoting is used that only quotes the string if needed to
+protect special characters.  Typically this form gives the most readable
+output.
 )
 item(tt(Q))(
 Remove one level of quotes from the resulting words.