Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Trying to reverse a word.
- X-seq: zsh-users 12060
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: Re: Trying to reverse a word.
- Date: Sat, 20 Oct 2007 05:22:55 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=aUkQBRZzgt1++3VvdzGMA1VaYM1Tu5sx2AzLvVvTjKc=; b=e3s07sCIP1pztGgAth84gDREw4/hBnGF851TQhhZyj5tp0IaQyK+DuscJ/lCnvgeBsWHYFa4G9YN1xK6g6gbh/hyVzEGzqQINVq5wfYOYvYhjJoyza2xYWtzeoN8IC56cd1MfbKxhtA+YBWEYILnFNdC7W4yGsVT27jBx+Zo7UA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aVWkSzaFPXZqOaUzOnzIHLBiT7OH8iqJxDpVujngRoGJiadUeIO5kLJ001V4FNW5ObFBqjH21l3bJH6OOgVc7lpcvMwYBxoj5glb7CcZBC2CHt+rZEXGNgWrGr0qHdw5sH3q6ABPxw6LQfwbHRf6qCRAo0eFikHZ4bZoqABKkZY=
- In-reply-to: <071019200703.ZM14580@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0710191501w1402669eh60c481a249c7ed6c@xxxxxxxxxxxxxx> <071019200703.ZM14580@xxxxxxxxxxxxxxxxxxxxxx>
On 20/10/2007, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Oct 20, 12:01am, Mikael Magnusson wrote:
> } Subject: Trying to reverse a word.
> }
> } % echo "${(j::)${(Oa)${(s::):-hello}}}"
> } h e l l o
> } What the heck is going on here?
>
> The double quotes cause ${(Oa)${(s::):-hello}} to be joined with the
> default IFS before the (j::) is ever applied. Add an (@) to force
> that array to remain an array:
>
> echo "${(j::)${(@Oa)${(s::):-hello}}}"
Aha, thanks. Something of a mystery to me how the quotes outside the
outermost ${} can affect something inside, but maybe it's better not
to know. ${(j::)${(#)${(@Oa)${(s:-:):-41-45-58}}}}
(why does that break in double quotes? heh).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author