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 26316
 
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
 
- To: zsh-workers@xxxxxxxxxx
 
- Subject: Re: treatment of empty strings - why is this not a bug?
 
- Date: Thu, 15 Jan 2009 15:11:08 -0500
 
- In-reply-to: <20090113220810.5ee564eb@pws-pc> (Peter Stephenson's message of "Tue, 13 Jan 2009 22:08:10 +0000")
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
 
- References: <18796.17298.94642.461735@xxxxxxxxxxxxxxxxxx>	<20090113192409.0c21909a@pws-pc> <20090113220810.5ee564eb@pws-pc>
 
- Reply-to: gak@xxxxxxxxxxxxxx
 
>>>>> Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> writes:
> It's not a bug because it's documented to do something incredibly
> pointless:
If the reason for this behavior is incredibly pointless, should there
be a shell option to change the default to the more reasonable thing?
>   For historical reasons, the usual behaviour that empty array elements
>   are retained inside double quotes is disabled for arrays generated
>   by splitting; hence the following:
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= =><=
thanks,
Greg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author