Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
${(s::)VAR} vs "${(s::)VAR}"
- X-seq: zsh-users 17025
- From: Kynn Jones <kynnjo@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: ${(s::)VAR} vs "${(s::)VAR}"
- Date: Thu, 26 Apr 2012 16:48:00 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hgTsDiqmuYoGMQn4MIX7h2YZEWlhBIu+EkD5aA8nqi8=; b=KuZHzXJ0x7Y+yb9V5jjMFIQYGrCRi8SN8VaMmn53op2LyyASomNS2pZydmiby65Pgb zrBtKozANUP7Jr37/2wpJocmB6JGt83Zzj8+YZxoTIRPnzHVvTEOzC4llebNP7lth1ak znbzJWrxgShfjhvLIZ6aiZdXgWYBwUB0bII47C2mjTjlgdxALECzrBTn2qjeY8hLBojF t60gk2ACyLDvnZGHDJWvr2mNYWoaX2dvjIB43BOUh/acSMYwIoFgde5UrEmmf20yk+dy or9uJe1encucjnaiGOKEfOdA03e031gvVOjw4R7Mwz01IOYJcVJcpwChgYUk+JNRJc85 GyOg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi!
I was surprised by the following (note that the first output consists of
3 lines while the second output consists of 4; the only difference between
the two cases is that the first one iterates over ${(s::)VAR} while the
second does so over its double-quoted variant, "${(s::)VAR}"):
% (VAR=123; for c ( ${(s::)VAR} ) echo ">$c<")
>1<
>2<
>3<
% (VAR=123; for c ( "${(s::)VAR}" ) echo ">$c<")
>1<
>2<
>3<
><
Even after-the-fact I cannot explain this difference. I would appreciate
a description of what's going on (and that, I hope, will lead to the
sought-after explanation).
Thanks!
kj
Messages sorted by:
Reverse Date,
Date,
Thread,
Author