From: Kynn Jones <kynnjo@gmail.com>
To: zsh-users@zsh.org
Subject: ${(s::)VAR} vs "${(s::)VAR}"
Date: Thu, 26 Apr 2012 16:48:00 -0400 [thread overview]
Message-ID: <CAFvQaj4rz82ByYJGhWBG-pZzZuJk4myGBsuSvj_PF64_HCfu1w@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
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
next reply other threads:[~2012-04-26 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 20:48 Kynn Jones [this message]
2012-04-27 20:38 ` Peter Stephenson
2012-04-28 2:50 ` Bart Schaefer
2012-04-29 18:22 ` Peter Stephenson
2012-04-29 18:41 ` Peter Stephenson
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=CAFvQaj4rz82ByYJGhWBG-pZzZuJk4myGBsuSvj_PF64_HCfu1w@mail.gmail.com \
--to=kynnjo@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).