Zsh Mailing List Archive
Messages sorted by:
[PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs
- X-seq: zsh-workers 49183
- From: gammafn <GammaFunction@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: gammafn <GammaFunction@xxxxxxxxxxx>
- Subject: [PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs
- Date: Wed, 21 Jul 2021 15:40:34 -0500
- Archived-at: <https://zsh.org/workers/49183>
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net 3AFADBD01C
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net A30E6BD031
- List-id: <zsh-workers.zsh.org>
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
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
@@ -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.
@@ -669,11 +677,6 @@ the prompt. If var(word) is omitted, then a standard message is printed.
-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
In the following expressions, when var(name) is an array and
the substitution is not quoted, or if the `tt((@))' flag or the
Messages sorted by: