zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs
@ 2021-07-21 20:40 gammafn
  0 siblings, 0 replies; only message in thread
From: gammafn @ 2021-07-21 20:40 UTC (permalink / raw)
  To: zsh-workers; +Cc: gammafn

---
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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-21 20:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 20:40 [PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs gammafn

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).