zsh-users
 help / color / mirror / code / Atom feed
* transformations of glob results
@ 2015-09-23  8:06 Marc Chantreux
  2015-09-23 13:49 ` Mikael Magnusson
  2015-09-23 14:58 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Chantreux @ 2015-09-23  8:06 UTC (permalink / raw)
  To: zsh-users

hello people,

i wrote a glob result transformation that way:

    l=( /etc/sympa/*/robot.conf(:h:t) )
    l=( listmaster@$^l )
    print ${(j:,:)l}

but i really would like to know if there is a simple, readable way to
write it in one expression. the perl counterpart would be

    join ','
    , map 'listmaster@'.(split "/")[-2]
    , glob "/etc/*/robot.conf"

and i tried variations around

    print ${(j:,:)${(@)listmaster@${(^) /etc/sympa/*/robot.conf(:h:t) }}}

which

    * doesn't work
    * actually looks ugly

any help from a zsh poweruser ?

regards

-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
    -- Abraham Lincoln


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

end of thread, other threads:[~2015-09-23 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-23  8:06 transformations of glob results Marc Chantreux
2015-09-23 13:49 ` Mikael Magnusson
2015-09-23 14:41   ` Marc Chantreux
2015-09-23 20:59     ` Mikael Magnusson
2015-09-23 14:58 ` Bart Schaefer

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).