From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10120 invoked from network); 4 Dec 2005 00:16:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Dec 2005 00:16:35 -0000 Received: (qmail 72924 invoked from network); 4 Dec 2005 00:16:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Dec 2005 00:16:29 -0000 Received: (qmail 29578 invoked by alias); 4 Dec 2005 00:16:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9748 Received: (qmail 29569 invoked from network); 4 Dec 2005 00:16:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Dec 2005 00:16:21 -0000 Received: (qmail 71851 invoked from network); 4 Dec 2005 00:16:20 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 4 Dec 2005 00:16:19 -0000 Received: from candle.brasslantern.com ([71.116.81.225]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IQY00A7W6356K44@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Sat, 03 Dec 2005 18:16:18 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id jB40GHM0015246 for ; Sat, 03 Dec 2005 16:16:17 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id jB40GHmg015245 for zsh-users@sunsite.dk; Sat, 03 Dec 2005 16:16:17 -0800 Date: Sun, 04 Dec 2005 00:16:16 +0000 From: Bart Schaefer Subject: Re: Is this a side effect of RC_EXPAND_PARAM? In-reply-to: <20051202210456.GA821@DervishD> To: Zsh Users Message-id: <1051204001616.ZM15244@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20051202210456.GA821@DervishD> Comments: In reply to DervishD "Is this a side effect of RC_EXPAND_PARAM?" (Dec 2, 10:04pm) On Dec 2, 10:04pm, DervishD wrote: } } What am I doing wrong? Is this a bug or a feature? zagzig% var="one|two||four|five" zagzig% print -l "${(s:|:)var}" one two four five zagzig% setopt rcexpandparam zagzig% print -l "${(s:|:)var}" one two four five zagzig% With rcexpandparam the empty element is retained so that it can be joined with whatever appears on both sides of the expansion (even though in this case that's nothing) so you get the equivalent of vara=("one" "two" "" "four" "five") whereas with it NOT set, the empty element is removed, so you get vara=(one two four five) Forcing empty elements to be retained as empty rather than removed is one reason the compsys functions have rcexpandparam set. Admittedly this ought to be documented, rather than assuming that anyone who sets rcexpandparam must be familiar with the semantics of the rc shell ...