diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-11-04 16:20:32 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-11-04 16:20:32 +0000 |
commit | 325f9c5deadd85d75860ca53b213961497d9e3c7 (patch) | |
tree | 32f3864c4da74549a6feffbc08db6aaa49133de5 /Doc/Zsh | |
parent | 0acbed6ab03d41391175baa10d16cd35cc5bf140 (diff) | |
download | zsh-325f9c5deadd85d75860ca53b213961497d9e3c7.tar.gz zsh-325f9c5deadd85d75860ca53b213961497d9e3c7.tar.xz zsh-325f9c5deadd85d75860ca53b213961497d9e3c7.zip |
users/9618, modified: :G for global substution modifier
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/expn.yo | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index c05796a94..b8aa1cfd8 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -117,6 +117,8 @@ repeats the last command, replacing the string var(foo) with var(bar). More precisely, the sequence `tt(^)var(foo)tt(^)var(bar)tt(^)' is synonymous with `tt(!!:s)tt(^)var(foo)tt(^)var(bar)tt(^)', hence other modifiers (see noderef(Modifiers)) may follow the final `tt(^)'. +In particular, `tt(^)var(foo)tt(^)var(bar)tt(:G)' performs a global +substitution. If the shell encounters the character sequence `tt(!")' in the input, the history mechanism is temporarily disabled until @@ -254,10 +256,14 @@ Convert the words to all uppercase. ) item(tt(s/)var(l)tt(/)var(r)[tt(/)])( Substitute var(r) for var(l) as described below. -Unless preceded immediately by a tt(g), with no colon between, -the substitution is done only for the +The substitution is done only for the first string that matches var(l). For arrays and for filename generation, this applies to each word of the expanded text. + +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. ) item(tt(&))( Repeat the previous tt(s) substitution. Like tt(s), may be preceded |