Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
transformations of glob results
- X-seq: zsh-users 20628
- From: Marc Chantreux <khatar@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: transformations of glob results
- Date: Wed, 23 Sep 2015 10:06:48 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author