Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: question of (C) and (s::)
- X-seq: zsh-users 17299
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: question of (C) and (s::)
- Date: Sun, 30 Sep 2012 09:00:23 -0700
- In-reply-to: <20120930073552.GC7385@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20120930073552.GC7385@localhost.localdomain>
On Sep 30, 3:35pm, Han Pingtian wrote:
}
} % x=foosbar;print ${(Cs:s:)x}
} Foo Bar
}
} But in rules of parameter expansion flags, "case mofification" is the
} 11th, "forced splitting" is the 16th, so I think we should get "Foo bar"
} as the result here. Right? Or I'm missing something here?
Hmm, I think "The Rules" have one thing out of place.
(f) and (s) and even the shell word splitting (both SH_WORD_SPLIT and
the '=' flag) are applied immediately after "forced joining". The only
thing that's delayed until just before "uniqueness" is the (z) flag.
Either this changed at some point (entirely possible as several tweaks
have been made over the years to make SH_WORD_SPLIT behave more like
the original /bin/sh) or the code in subst.c was misread when the rules
were composed (the comment in subst.c explaining that the (z) section
doesn't have anything to do with (s) post-dates the rules).
So really 16 and 17 should be combined as 11 except that mention of (z)
should be removed from the new 11; the old 11 through 15 should be
renumbered 12 through 16; and 17 should be the (z) flag by itself.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author