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

Re: field splitting with empty fields



On Tue, Oct 30, 2007 at 12:04:53PM +0000, Peter Stephenson wrote:
[...]
> > I've myself already relied on it before, though many other
> > times, it's true I have wished it was not removing empty items.
> 
> The interesting question is:  are there times when you need the double
> quotes (for some other reason), but *still* don't want empty elements
> removed?  That would explain the kludge.
[...]

I can't tell, probably not. 

Best would probably be to do a quick search for (f) and (s:...:)
in /usr/share/zsh to see if any of them rely on that.

I can see for instance:

4.3.4/functions/Completion/Unix/_java_class:for i in "${(s.:.)classpath}"; do

But in that case, it probably is more correct (if CLASSPATH is
meant to behave like PATH) to not strip the empty elements.

I agree with you that not removing the empty elements at that
stage makes more sense, given that it can be done later on by
not using @+quoting...

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author