diff options
author | Peter Stephenson <pws@zsh.org> | 2016-11-07 10:04:14 +0000 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2016-11-07 10:04:14 +0000 |
commit | 33b34890922b4f8ba47b68692d155611c0fc0f67 (patch) | |
tree | 0940eb1dabf570c547720a7fac45d0d55711426c | |
parent | bb28726fa5e29b7a5640cdab13e9d7a7e838f6a6 (diff) | |
download | zsh-33b34890922b4f8ba47b68692d155611c0fc0f67.tar.gz zsh-33b34890922b4f8ba47b68692d155611c0fc0f67.tar.xz zsh-33b34890922b4f8ba47b68692d155611c0fc0f67.zip |
zsh-users/22083: attempt to explain what a word is in parameter substitution.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Doc/Zsh/expn.yo | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index a3a8c00fa..c31db78a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-11-07 Peter Stephenson <p.stephenson@samsung.com> + + * zsh-users/22083: Doc/Zsh/expn.yo: attempt to explain a bit + better what a "word" is in parameter substitution. + 2016-11-07 Daniel Shahaf <d.s@daniel.shahaf.name> * 39840: Completion/Unix/Command/_cpio: Declare variable's 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. |