From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4984 invoked by alias); 7 Sep 2012 14:36:20 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17229 Received: (qmail 13158 invoked from network); 7 Sep 2012 14:36:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at biskalar.de does not designate permitted sender hosts) Subject: Re: double quoted expansion question Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=windows-1252 From: Sebastian Stark In-Reply-To: Date: Fri, 7 Sep 2012 16:36:09 +0200 Cc: zsh-users@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <5D910C9F-3338-49A2-9904-1EFF95C29050@biskalar.de> References: <29236168-55B5-4555-9ACA-B1D21D345EA9@biskalar.de> To: =?iso-8859-1?Q?J=E9r=E9mie_Roquet?= X-Mailer: Apple Mail (2.1278) Am 07.09.2012 um 14:54 schrieb J=E9r=E9mie Roquet: >>> print ${(s:,:uo)${(j:,:)${${(f)servers}//* /}}} >>=20 >> 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 >> =93//* /" expression suppresses everything before the last space, >> leaving only the tags of the last line. >=20 > No, this has nothing to do with $IFS actually, but you still have one = string: >=20 > $ a=3D(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=