Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: treatment of empty strings - why is this not a bug?
- X-seq: zsh-workers 26318
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: treatment of empty strings - why is this not a bug?
- Date: Thu, 15 Jan 2009 20:29:29 +0000
- In-reply-to: Message from Greg Klanderman <gak@xxxxxxxxxxxxxx> of "Thu, 15 Jan 2009 15:11:08 EST." <m3eiz4wcrn.fsf@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Greg Klanderman wrote:
> I still do not understand why I get exactly two empty strings no
> matter how many colons I have in the input string: I would expect
> none based on the description you cited.
>
> phl% x=::::: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done
> v= =><=
> v= =><=
> phl% x=: && for v in "${(s-:-)x}" ; do echo "v= =>$v<=" ; done
> v= =><=
> v= =><=
It's to do with the code that joins parameters with what's next to them,
which is why the RC_EXPAND_PARAM option is different. Quite why it does
what it does I don't understand either, however; but I don't really
understand this particular piece of traditional behaviour at all.
If I were changing it, rather than try to sanitize it I would simply
remove it.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author