zsh-users
 help / color / mirror / code / Atom feed
* prefix and join an array
@ 2020-04-29  2:14 sergio
  2020-04-29  3:51 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: sergio @ 2020-04-29  2:14 UTC (permalink / raw)
  To: zsh-users

Hello.

Is it possible to prefix and join an array:

% list=(a.tld b.tld c.tld)
% tmp=(DNS:${^list})
% print ${(j., .)tmp}
DNS:a.tld, DNS:b.tld, DNS:c.tld

but directly, without tmp, something like:

% print ${(j., .)(DNS:${^list})}


-- 
sergio.

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: prefix and join an array
@ 2020-04-29  4:22 Eric Nielsen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Nielsen @ 2020-04-29  4:22 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]


>> % print ${(j., .)${:-DNS:${^list}}}

> Haa, the secret was in ${name:-word}!

> Thank you, Bart (:

I think you can simplify it further to
print ${(j., .):-DNS:${^list}}
right?


^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <SC1P152MB1758B1DA12D7C4E477BB5C53EFAD0__34252.3257875413$1588134220$gmane$org@SC1P152MB1758.LAMP152.PROD.OUTLOOK.COM>]

end of thread, other threads:[~2020-04-30 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  2:14 prefix and join an array sergio
2020-04-29  3:51 ` Bart Schaefer
2020-04-29  4:09   ` sergio
2020-04-29  4:22 Eric Nielsen
     [not found] <SC1P152MB1758B1DA12D7C4E477BB5C53EFAD0__34252.3257875413$1588134220$gmane$org@SC1P152MB1758.LAMP152.PROD.OUTLOOK.COM>
2020-04-30 16:45 ` Stephane Chazelas

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