Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs



---
After some discussion on what does and does not happen in PEs on irc,
I added some more information on how the alternate value `word' is
expanded.  Additionally, I saw that `word' has documentation both
before and after the alternate value forms, so I unified the examples.

Should we also mention how quoting applies to `pattern', or is that
obvious enough?
 Doc/Zsh/expn.yo | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index c218ded05..594ef751f 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -616,6 +616,14 @@ substitution on the expansion of parameter tt($i).
 
 In the following descriptions, `var(word)' refers to a single word
 substituted on the command line, not necessarily a space delimited word.
+Therefore var(word) in unquoted parameter expansions can be subject
+to all expansions, but are not subject to splitting unless
+the parameter expansion is subject to tt(SH_WORD_SPLIT) option
+the tt(=) flag, or the tt(s:)var(string)tt(:) flag.
+
+Standard shell quoting in the var(word) value can be used to selectively override
+the splitting done by the tt(SH_WORD_SPLIT) option and the tt(=) flag,
+but not splitting by the tt(s:)var(string)tt(:) flag.
 
 startitem()
 item(tt(${)var(name)tt(}))(
@@ -669,11 +677,6 @@ the prompt.  If var(word) is omitted, then a standard message is printed.
 )
 enditem()
 
-In any of the above expressions that test a variable and substitute an
-alternate var(word), note that you can use standard shell quoting in the
-var(word) value to selectively override the splitting done by the
-tt(SH_WORD_SPLIT) option and the tt(=) flag, but not splitting by the
-tt(s:)var(string)tt(:) flag.
 
 In the following expressions, when var(name) is an array and
 the substitution is not quoted, or if the `tt((@))' flag or the
-- 
2.32.0





Messages sorted by: Reverse Date, Date, Thread, Author