From 33b34890922b4f8ba47b68692d155611c0fc0f67 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 7 Nov 2016 10:04:14 +0000 Subject: zsh-users/22083: attempt to explain what a word is in parameter substitution. --- Doc/Zsh/expn.yo | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index b73151698..f465b2f60 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -572,6 +572,18 @@ noderef(Modifiers) in noderef(History Expansion) can be applied: for example, tt(${i:s/foo/bar/}) performs string substitution on the expansion of parameter tt($i). +In the following descriptions, `word' refers to a single word +substituted on the command line, not necessarily a space delimited word. +With default options, after the assignments: + +example(array=("first word" "second word") +scalar="only word") + +then tt($array) substitutes two words, `tt(first word)' and `tt(second +word)', and tt($scalar) substitutes a single word `tt(only word)'. This +may be modified by explicit or implicit word-splitting, however. The +full rules are complicated and are noted at the end. + startitem() item(tt(${)var(name)tt(}))( The value, if any, of the parameter var(name) is substituted. -- cgit 1.4.1