zsh-users
 help / color / mirror / code / Atom feed
* double quoted expansion question
@ 2012-09-07 12:31 Sebastian Stark
  2012-09-07 12:47 ` Jérémie Roquet
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sebastian Stark @ 2012-09-07 12:31 UTC (permalink / raw)
  To: zsh-users

Dear zsh users,

I am trying to make a unique list of tags that is given in a string with a certain format, e.  g.:

  servers="
  madeira linux,gpu,users
  madeira2 linux,gpu,users
  smtp linux,mail,smtp
  isar linux,users
  easygwa linux,web,external
  "

The format is: server name, space, tag, comma, tag, comma, tag ...

What I want from the above list is this:

  external gpu linux mail smtp users web 

and I get it with:

  print  ${(s:,:uo)${(j:,:)${${(f)servers}//* /}}} 

However, if I do this:

  print "${(s:,:uo)${(j:,:)${${(f)servers}//* /}}}"

I get:

  external linux web

This also happens when I use the variable expansion expression in a here document, which, I suppose, is undergoing the same treatment as double quoted strings.

What I would like to understand here is why the output changes the way it does when I add double quotes around my expression. I would expect the same output as without. If anybody could shed some light please, I guess it's just something obvious I cannot see.


Sebastian



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

end of thread, other threads:[~2012-09-08  5:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07 12:31 double quoted expansion question Sebastian Stark
2012-09-07 12:47 ` Jérémie Roquet
2012-09-07 12:54   ` Jérémie Roquet
2012-09-07 14:36     ` Sebastian Stark
2012-09-07 14:41 ` Bart Schaefer
2012-09-07 15:43 ` Sebastian Stark
2012-09-08  5:38   ` 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).