From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28932 invoked by alias); 13 Sep 2011 08:22:08 -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: 16333 Received: (qmail 9505 invoked from network); 13 Sep 2011 08:22:07 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at benizi.com does not designate permitted sender hosts) Date: Tue, 13 Sep 2011 04:15:50 -0400 (EDT) From: "Benjamin R. Haskell" To: Zsh Users Subject: Expand array into multiple elements per item? Message-ID: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII 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. -- Best, Ben