From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11770 invoked from network); 30 Jun 2009 15:20:03 -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 new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 30 Jun 2009 15:20:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 14898 invoked from network); 30 Jun 2009 15:19:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jun 2009 15:19:56 -0000 Received: (qmail 12070 invoked by alias); 30 Jun 2009 15:19:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27075 Received: (qmail 12048 invoked from network); 30 Jun 2009 15:19:47 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Jun 2009 15:19:47 -0000 Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by bifrost.dotsrc.org (Postfix) with ESMTP id 72443801E289 for ; Tue, 30 Jun 2009 17:19:44 +0200 (CEST) Received: by ewy18 with SMTP id 18so257009ewy.45 for ; Tue, 30 Jun 2009 08:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mKsf3eG7wDuD/MWavp9Wm8jH+ebgBwUxVkS30pjYny0=; b=t3tNxod7FHBNi39y0O0h0pwLl51BUH775sbhGVcpGxS0tcgpKlL58vaTA+SyTkD4yH lNGHPv0fqALQk6CaoJbLWJcDrKyIGhKeM3HULeCx+bT1yuJzi69abmFPuddKsp0stBfJ BNQW8cfsVZby7K2Xgs9i3O51ntozuDIThcgOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=O4EzeGDpI/zKmaIqBDGHZuufBXsFlWrv9Mk/awEMLE/mYu6fNIN/hunsSO1YV0dRIL yfZj4wWVKuMMlScxqJnLvoYQls+x3kwIaGmHNRIx7iyo+QiFz4ne373M8sDdORxPlOTZ 4ciT3qR2yMDvphQkcTYQ1q2HJdwmAM2BHGTi0= MIME-Version: 1.0 Received: by 10.210.35.10 with SMTP id i10mr3557693ebi.34.1246375184096; Tue, 30 Jun 2009 08:19:44 -0700 (PDT) In-Reply-To: References: <19017.33909.493608.356003@gargle.gargle.HOWL> <200906300843.n5U8hecG011236@news01.csr.com> Date: Tue, 30 Jun 2009 17:19:44 +0200 Message-ID: <237967ef0906300819g4c0a6059rfac9d21b565cc4f0@mail.gmail.com> Subject: Re: use 'P' parameter expansion flag with array? From: Mikael Magnusson To: zsh-workers@sunsite.dk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.94.2/9523/Tue Jun 30 15:32:25 2009 on bifrost X-Virus-Status: Clean 2009/6/30 Greg Klanderman : > >> It does seem logical, but the code is obscure and it's not clear whether >> this was intended or not---it probably fell through the cracks. > > Thank you Peter, I'll just use a loop then.. > >> paramsubst() is full of my "one day someone should spend a year tidying >> this up" comments. > > Yeah I enjoyed reading a number of those last night after sending > that question =C2=A0:-) > > So if I have an array and want to append a string to each of the > elements, then join with colon, is there a better way than this: > > lwm% a=3D(x y z) > lwm% echo ${(j.:.)${(@)a/%/foo}} > xfoo:yfoo:zfoo > > I was trying to do something using '^' but it doesn't seem to work; > > lwm% echo ${(@)^a}foo > xfoo yfoo zfoo > > does what I expect, but: > > lwm% echo ${(j.:.)${(@)^a}foo} > zsh: bad substitution > > does not. echo ${(j.:.):-${(@)^a}foo} will work fine, the simplest case of the error is this, i think: % echo ${${}foo} zsh: bad substitution % echo ${:-${}foo} foo --=20 Mikael Magnusson