From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14977 invoked by alias); 13 Sep 2011 09:06:41 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16336 Received: (qmail 6891 invoked from network); 13 Sep 2011 09:06:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_SC_TOP_CIDR8,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=l5mGj4+HeZmzSTSqml7sVxdzwHM6RL3wEoCrFkpeGAw=; b=c2ZCQQoBsV5zxeMnVkejm8HeP7/4lj/6t9SUERa/6ymKweAzL1AHH7wQudrWbGgH2s Lf+AzksxCPuTm/MH9xdm07GxlZYwW9UI1A1svd6rr8ggLk8nKNZeoz1A5rrJeCpQPKQu VtM34TkNGY8n5u5CvsT0iTdhVbqYvOTKh1ndc= Date: Tue, 13 Sep 2011 10:36:41 +0200 From: Anthony Charles To: "Benjamin R. Haskell" Cc: Zsh Users Subject: Re: Expand array into multiple elements per item? Message-ID: <20110913083641.GD4542@layslair.ath.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Hi, You can try this : print -l -- "-id "$^somelist anotherlist=( "-id "$^somelist ) But I can't give you any answer for question 2 :/ -- Anthony CHARLES On Tue, Sep 13, 2011 at 04:15:50AM -0400, Benjamin R. Haskell wrote: > Three questions: > > 1. How can I easily take: > > somelist=( 'a b' c 'd e' ) > > and get back: > > anotherlist=( -id 'a b' -id c -id 'd e' ) > > 2. ...relatedly, I'm confused by the following: > > $ somelist=( 'a b' c 'd e' ) > $ print -l - $somelist > a b > c > d e > (i) $ print -l - $^somelist(e:'reply=( -id $REPLY )':) > zsh: no matches found: a b(e:reply=( -id $REPLY ):) > (ii) $ print -l - $^somelist(Ne:'reply=( -id $REPLY )':) > (...nothing printed...) > $ > > Why does neither (i) nor (ii) work? > > 3. I thought I recalled a relatively recent addition to parameter > expansion flags for just this use-case. But I can't seem to find > the flag in zsh-4.3.12 patchlevel 1.5346. Still interested in the > answer to the rest, regardless. >