zsh-users
 help / color / mirror / code / Atom feed
* Expand array into multiple elements per item?
@ 2011-09-13  8:15 Benjamin R. Haskell
  2011-09-13  8:36 ` Anthony Charles
  2011-09-13  8:57 ` Peter Stephenson
  0 siblings, 2 replies; 8+ messages in thread
From: Benjamin R. Haskell @ 2011-09-13  8:15 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-15 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13  8:15 Expand array into multiple elements per item? Benjamin R. Haskell
2011-09-13  8:36 ` Anthony Charles
2011-09-13  8:52   ` Benjamin R. Haskell
2011-09-15 18:07     ` Oliver Kiddle
2011-09-13  8:57 ` Peter Stephenson
2011-09-13 10:19   ` Mikael Magnusson
2011-09-13 17:32     ` Benjamin R. Haskell
2011-09-13 17:21   ` Benjamin R. Haskell

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).