zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Stark <seb-zsh@biskalar.de>
To: "Jérémie Roquet" <arkanosis@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: double quoted expansion question
Date: Fri, 7 Sep 2012 16:36:09 +0200	[thread overview]
Message-ID: <5D910C9F-3338-49A2-9904-1EFF95C29050@biskalar.de> (raw)
In-Reply-To: <CAFOazAOAis5Y3H5rEmEe8pWZwcRt4oR4TuaOc6ycets_wPxfkQ@mail.gmail.com>


Am 07.09.2012 um 14:54 schrieb Jérémie Roquet:
>>>  print  ${(s:,:uo)${(j:,:)${${(f)servers}//* /}}}
>> 
>> I'm not 100 % sure, but I suppose the quotes prevents the shell from
>> splitting your string on $IFS, so you only have *one* string, and the
>> “//* /" expression suppresses everything before the last space,
>> leaving only the tags of the last line.
> 
> No, this has nothing to do with $IFS actually, but you still have one string:
> 
> $ a=(za zb zc zd)
> $ echo ${a/z/v}
> va vb vc vd
> $ echo "${a/z/v}"
> va zb zc zd

Thanks, I just figured that this must be the kind of brain damage they mention in zshexpn(1), and using this:

  $(awk '{print $2}' <<<$servers | tr , '\n' | sort -u | tr '\n' ' ')

seems like a much saner way to achieve the same :) But not very zshy...


Sebastian

  reply	other threads:[~2012-09-07 14:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07 12:31 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 [this message]
2012-09-07 14:41 ` Bart Schaefer
2012-09-07 15:43 ` Sebastian Stark
2012-09-08  5:38   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D910C9F-3338-49A2-9904-1EFF95C29050@biskalar.de \
    --to=seb-zsh@biskalar.de \
    --cc=arkanosis@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).