Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to substitute empty array element, or empty string



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