From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13609 invoked by alias); 13 Sep 2011 08:52: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: 16334 Received: (qmail 19532 invoked from network); 13 Sep 2011 08:52:39 -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:52:11 -0400 (EDT) From: "Benjamin R. Haskell" To: Anthony Charles cc: Zsh Users Subject: Re: Expand array into multiple elements per item? In-Reply-To: <20110913083641.GD4542@layslair.ath.cx> Message-ID: References: <20110913083641.GD4542@layslair.ath.cx> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 13 Sep 2011, Anthony Charles wrote: > Hi, > > You can try this : > print -l -- "-id "$^somelist > > anotherlist=( "-id "$^somelist ) > > But I can't give you any answer for question 2 :/ anotherlist should end up as I specified before: $ anotherlist=( -id 'a b' -id c -id 'd e' ) I.e. separate elements, but not just word-splitting everything: $ print -l - $^anotherlist -id <-- separate a b <-- kept as one argument -id <-- separate c -id <-- separate d e <-- kept as one argument With your suggestions the -id isn't a separate element: $ print -l - "-id "$^somelist -id a b -id c -id d e $ anotherlist=( "-id "$^somelist ) $ print -l - $^anotherlist -id a b -id c -id d e -- Best, Ben