From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19681 invoked from network); 11 Aug 2005 16:39:36 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Aug 2005 16:39:36 -0000 Received: (qmail 32068 invoked from network); 11 Aug 2005 16:39:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Aug 2005 16:39:30 -0000 Received: (qmail 16877 invoked by alias); 11 Aug 2005 16:39:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9294 Received: (qmail 16868 invoked from network); 11 Aug 2005 16:39:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Aug 2005 16:39:22 -0000 Received: (qmail 31133 invoked from network); 11 Aug 2005 16:39:22 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 11 Aug 2005 16:39:18 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IL200HORGU47BJ7@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Thu, 11 Aug 2005 11:37:17 -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 j7BGbFSM002500 for ; Thu, 11 Aug 2005 09:37:15 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j7BGbFmh002499 for zsh-users@sunsite.dk; Thu, 11 Aug 2005 09:37:15 -0700 Date: Thu, 11 Aug 2005 16:37:14 +0000 From: Bart Schaefer Subject: Re: Printing arrays for use with $() In-reply-to: <20050811161654.GA8200@DervishD> To: Zsh Users Message-id: <1050811163714.ZM2498@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> Comments: In reply to DervishD "Printing arrays for use with $()" (Aug 11, 6:16pm) 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 11, 6:16pm, DervishD wrote: } } Is there any way for printing the array to stdout and being able } to use that output as arguments for another command? The short answer is, no. The long answer is that *something* has to understand the format of the printed output and convert it back into individual strings. That means that either (1) you need a command that reads from standard input rather than taking command line arguments, or (2) you must be in control of the command line so that you can do the appropriate parsing yourself. For an example of (2), you could print -N -- $array but then the caller must have IFS=$'\0' to split on the nuls without also splitting on whitespace.