Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Changes for dev-4
- X-seq: zsh-workers 22275
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Changes for dev-4
- Date: Thu, 16 Feb 2006 12:26:34 -0800
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <EXCHANGE03FXfyY0QUU0000e4ba@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <EXCHANGE032tgQSYwpb0000e051@xxxxxxxxxxxxxxxxxx> <20060216190317.GC1320@xxxxxxxxxxxxx> <EXCHANGE03FXfyY0QUU0000e4ba@xxxxxxxxxxxxxxxxxx>
On Thu, Feb 16, 2006 at 07:35:26PM +0000, Peter Stephenson wrote:
> I would guess that with zsh's ability to assign arrays it would be
> better to keep this consistent with the other forms, as in your patch,
> however.
OK, I've checked it in. I also made a few more tweaks to the zshexpn
man page where it talks about field splitting.
..wayne..
--- Doc/Zsh/expn.yo 15 Feb 2006 10:13:46 -0000 1.61
+++ Doc/Zsh/expn.yo 16 Feb 2006 20:23:05 -0000
@@ -444,6 +444,7 @@ element of var(name) is substituted, one
expansion results in one word only; with tt(KSH_ARRAYS), this is the first
element of an array. No field splitting is done on the result unless the
tt(SH_WORD_SPLIT) option is set.
+See also the flags tt(=) and tt(s:)var(string)tt(:).
)
item(tt(${PLUS())var(name)tt(}))(
If var(name) is the name of a set parameter `tt(1)' is substituted,
@@ -454,7 +455,8 @@ If var(name) is set and is non-null then
value; otherwise substitute var(word). If var(name) is
missing, substitute var(word).
Note that you can use standard shell quoting in the var(word) value to
-selectively override any field splitting that may be active.
+selectively override the splitting done by the tt(SH_WORD_SPLIT) option
+and the tt(=) flag, but not the tt(s:)var(string)tt(:) flag.
)
xitem(tt(${)var(name)tt(:=)var(word)tt(}))
item(tt(${)var(name)tt(::=)var(word)tt(}))(
@@ -473,7 +475,8 @@ item(tt(${)var(name)tt(:PLUS())var(word)
If var(name) is set and is non-null then substitute
var(word); otherwise substitute nothing.
Note that you can use standard shell quoting in the var(word) value to
-selectively override any field splitting that may be active.
+selectively override the splitting done by the tt(SH_WORD_SPLIT) option
+and the tt(=) flag, but not the tt(s:)var(string)tt(:) flag.
)
enditem()
@@ -839,8 +842,8 @@ in string arguments to any of the flags
item(tt(j:)var(string)tt(:))(
Join the words of arrays together using var(string) as a separator.
pindex(SH_WORD_SPLIT, use of)
-Note that this occurs before field splitting by the tt(SH_WORD_SPLIT)
-option.
+Note that this occurs before field splitting by the tt(s:)var(string)tt(:)
+flag or the tt(SH_WORD_SPLIT) option.
)
item(tt(l:)var(expr)tt(::)var(string1)tt(::)var(string2)tt(:))(
Pad the resulting words on the left. Each word will be truncated if
@@ -855,10 +858,11 @@ As tt(l), but pad the words on the right
on the right.
)
item(tt(s:)var(string)tt(:))(
-Force field splitting (see the option tt(SH_WORD_SPLIT)) at the
+Force field splitting at the
separator var(string). Note that a var(string) of two or more
characters means that all of them must match in sequence; this differs from
the treatment of two or more characters in the tt(IFS) parameter.
+See also the tt(=) flag and the tt(SH_WORD_SPLIT) option.
)
enditem()
Messages sorted by:
Reverse Date,
Date,
Thread,
Author