From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7781 invoked from network); 13 Aug 2005 01:34:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Aug 2005 01:34:24 -0000 Received: (qmail 41181 invoked from network); 13 Aug 2005 01:34:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Aug 2005 01:34:18 -0000 Received: (qmail 26947 invoked by alias); 13 Aug 2005 01:34:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9309 Received: (qmail 26938 invoked from network); 13 Aug 2005 01:34:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Aug 2005 01:34:10 -0000 Received: (qmail 40097 invoked from network); 13 Aug 2005 01:34:10 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 13 Aug 2005 01:34:06 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IL5004TY0CSFAL1@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 12 Aug 2005 20:34:05 -0500 (CDT) 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 j7D1Y3nQ013843 for ; Fri, 12 Aug 2005 18:34:03 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j7D1Y3Ea013842 for zsh-users@sunsite.dk; Fri, 12 Aug 2005 18:34:03 -0700 Date: Sat, 13 Aug 2005 01:34:02 +0000 From: Bart Schaefer Subject: Re: Printing arrays for use with $() In-reply-to: <20050812145208.GA234@DervishD> In-reply-to: <20050812145734.GB234@DervishD> To: Zsh Users Message-id: <1050813013402.ZM13841@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050811161654.GA8200@DervishD> <1050811163714.ZM2498@candle.brasslantern.com> <20050811170124.GA8279@DervishD> <20050811222847.GA341@DervishD> <1050812022700.ZM12607@candle.brasslantern.com> <20050812082909.GB354@DervishD> <1050812143713.ZM13160@candle.brasslantern.com> <20050812145208.GA234@DervishD> <20050812143240.GA200@DervishD> <20050812145734.GB234@DervishD> Comments: In reply to DervishD "Re: Printing arrays for use with $()" (Aug 12, 4:52pm) Comments: In reply to DervishD "Re: Printing arrays for use with $()" (Aug 12, 4:57pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Aug 12, 4:52pm, DervishD wrote: } } > array=( ${(ps:\0:)"$(print -rN -- $list)"} ) } } I've posted a minute ago a possible solution, using more or less } the same mechanism, only I was using ':' as the separator and not } '\0' because it doesn't work for me. I gather from your subsequent posting that you got it to work after all. On Aug 12, 4:57pm, DervishD wrote: } } array=( ${(ps:\0:)"$(print -N -- $list)"} ) I still recommend "print -rN" here. } Although I don't know why I need the double quotes if I use ":-" } after the (ps) flag :? Is to avoid the shell splitting the entire } string in the assignment before we can do the (ps)? The results of $(...) and `...` are always subject to word splitting unless quoted. It's part of the definition of those substitutions. So, yes.