From 21193d7f0128dc66f4c41c7b06d1d20c5b9339fc Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 27 Feb 2010 00:18:13 +0000 Subject: users/14905 + 14906: problems with :s in parameter expansion --- Doc/Zsh/expn.yo | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 6b020a280..7e55ff419 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -273,6 +273,8 @@ The forms `tt(gs/)var(l)tt(/)var(r)' and `tt(s/)var(l)tt(/)var(r)tt(/:G)' perform global substitution, i.e. substitute every occurrence of var(r) for var(l). Note that the tt(g) or tt(:G) must appear in exactly the position shown. + +See further notes on this form of substitution below. ) item(tt(&))( Repeat the previous tt(s) substitution. Like tt(s), may be preceded @@ -293,18 +295,18 @@ parameter expansion. ) enditem() -The tt(s/l/r/) substitution works as follows. By default the left-hand -side of substitutions are not patterns, but character strings. Any -character can be used as the delimiter in place of `tt(/)'. A -backslash quotes the delimiter character. The character `tt(&)', in -the right-hand-side var(r), is replaced by the text from the +The tt(s/)var(l)tt(/)var(r)tt(/) substitution works as follows. By +default the left-hand side of substitutions are not patterns, but +character strings. Any character can be used as the delimiter in place +of `tt(/)'. A backslash quotes the delimiter character. The character +`tt(&)', in the right-hand-side var(r), is replaced by the text from the left-hand-side var(l). The `tt(&)' can be quoted with a backslash. A -null var(l) uses the previous string either from the previous var(l) -or from the contextual scan string var(s) from `tt(!?)var(s)'. You can +null var(l) uses the previous string either from the previous var(l) or +from the contextual scan string var(s) from `tt(!?)var(s)'. You can omit the rightmost delimiter if a newline immediately follows var(r); -the rightmost `tt(?)' in a context scan can similarly be omitted. -Note the same record of the last var(l) and var(r) is maintained -across all forms of expansion. +the rightmost `tt(?)' in a context scan can similarly be omitted. Note +the same record of the last var(l) and var(r) is maintained across all +forms of expansion. If the option tt(HIST_SUBST_PATTERN) is set, var(l) is treated as a pattern of the usual form described in -- cgit 1.4.1