Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to substitute empty array element, or empty string
- X-seq: zsh-users 22609
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to substitute empty array element, or empty string
- Date: Fri, 24 Mar 2017 11:49:03 +0000
- Cms-type: 201P
- In-reply-to: <etPan.58d5027c.6b8b4567.166db@MacMini.local>
- 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
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20170322075332epcas3p4a32050e48ad0f94be13134b560f17715@epcas3p4.samsung.com> <etPan.58d22d29.6b8b4567.10ab3@MacMini.local> <20170322095212.2ff2dec8@pwslap01u.europe.root.pri> <etPan.58d5027c.6b8b4567.166db@MacMini.local>
On Fri, 24 Mar 2017 12:26:52 +0100
Sebastian Gniazdowski <psprint@xxxxxxxxxxx> wrote:
> On 23.03.2017 at 03:04:40, Peter Stephenson (p.stephenson@xxxxxxxxxxx) wrote:
> > This might be one of those "bug" things you sometimes read about for other
> > projects…
> (…)
> > + print -rl -- "${(@)a//*/x}"
>
> I'm little thrilled that this goes away from how // "typically"
> works. In bash // also doesn't match empty element. Maybe it's a Posix
> thing?
Hard to see:
[[ '' = * ]] && echo yes
echoes "yes" in bash as well as zsh, so "*" can match an empty string,
and I don't think the / and // operators are standardised.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author