From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21886 invoked from network); 15 Jan 2009 20:11:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Jan 2009 20:11:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 61040 invoked from network); 15 Jan 2009 20:11:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jan 2009 20:11:20 -0000 Received: (qmail 26802 invoked by alias); 15 Jan 2009 20:11:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26316 Received: (qmail 26791 invoked from network); 15 Jan 2009 20:11:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 15 Jan 2009 20:11:14 -0000 Received: from QMTA05.westchester.pa.mail.comcast.net (qmta05.westchester.pa.mail.comcast.net [76.96.62.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id 4B91280271F0 for ; Thu, 15 Jan 2009 21:11:10 +0100 (CET) Received: from OMTA12.westchester.pa.mail.comcast.net ([76.96.62.44]) by QMTA05.westchester.pa.mail.comcast.net with comcast id 3syC1b00m0xGWP855wBAX2; Thu, 15 Jan 2009 20:11:10 +0000 Received: from smtp.klanderman.net ([98.217.254.247]) by OMTA12.westchester.pa.mail.comcast.net with comcast id 3wBA1b00L5M2Np63YwBA4d; Thu, 15 Jan 2009 20:11:10 +0000 Received: from lwm.klanderman.net (unknown [192.168.100.50]) by smtp.klanderman.net (Postfix) with ESMTP id 23C90B30148 for ; Thu, 15 Jan 2009 15:11:09 -0500 (EST) Received: by lwm.klanderman.net (Postfix, from userid 500) id EC08C9FC5E5; Thu, 15 Jan 2009 15:11:08 -0500 (EST) From: Greg Klanderman To: zsh-workers@sunsite.dk Subject: Re: treatment of empty strings - why is this not a bug? Reply-To: gak@klanderman.net 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") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (linux) References: <18796.17298.94642.461735@gargle.gargle.HOWL> <20090113192409.0c21909a@pws-pc> <20090113220810.5ee564eb@pws-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.92.1/8869/Thu Jan 15 18:37:21 2009 on bifrost X-Virus-Status: Clean >>>>> Peter Stephenson 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