From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7351 invoked from network); 11 Aug 2005 20:06:08 -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 20:06:08 -0000 Received: (qmail 53771 invoked from network); 11 Aug 2005 20:06:02 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Aug 2005 20:06:02 -0000 Received: (qmail 17954 invoked by alias); 11 Aug 2005 20:05:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9298 Received: (qmail 17944 invoked from network); 11 Aug 2005 20:05:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Aug 2005 20:05:54 -0000 Received: (qmail 52785 invoked from network); 11 Aug 2005 20:05:54 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 11 Aug 2005 20:05:47 -0000 Received: from 212.red-80-35-44.pooles.rima-tde.net ([80.35.44.212] helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.51) id 1E3JJH-0002oL-0J; Thu, 11 Aug 2005 22:05:51 +0200 Date: Thu, 11 Aug 2005 22:09:13 +0200 From: DervishD To: Dan Nelson Cc: Zsh Users Subject: Re: Printing arrays for use with $() Message-ID: <20050811200913.GA151@DervishD> Mail-Followup-To: Dan Nelson , Zsh Users References: <20050811161654.GA8200@DervishD> <20050811194046.GB49463@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050811194046.GB49463@dan.emsphone.com> User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: 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.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 Hi Dan :) * Dan Nelson dixit: > Why not use ${(q)array}? You probably also want to use print -r, > othersize it will try and parse \-escape codes. > > dan% a=("file name" single\'quote double\"quote) > dan% echo ${(q)a} > file\ name single\'quote double\"quote > dan% echo ${(qq)a} > 'file name' 'single'\''quote' 'double"quote' > dan% echo ${(qqq)a} > "file name" "single'quote" "double\"quote" > dan% print -l -- ${(qq)a} > 'file name' > 'single'''quote' > 'double"quote' > dan% print -rl -- ${(qq)a} > 'file name' > 'single'\''quote' > 'double"quote' Try, with your example, this: du $(print -lr -- ${(q)a}) or any other of the examples ;) They will fail with exactly the same problem I'm currently having. The problem is that the "print" command doesn't quote properly its output (obviously, it has to *print* it, not quote it to make it munchable for other commands). Thanks anyway :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to...