From: Ian F <in4mer@gmail.com>
To: zsh-workers@zsh.org
Subject: A strange quoted nested evaluation issue
Date: Mon, 19 Nov 2018 00:04:47 -0800 [thread overview]
Message-ID: <CAMeu-1UHG4NvYW2gB4QFYoUAKbMgzFnz21QBXxACA5n7L7x8jA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
Hi,
Can anyone shed some light On This One?
tl;dr: Enclosing a nested length eval on an empty var changes its answer
from 0 to 1 when in double quotes.
% for baz in "" "inga"; do
echo ${#${baz}} "${#${baz}}" ${#baz} "${#baz}"
done
0 1 0 0
4 4 4 4
%
Normally I wouldn't mail the list about this kind of thing, but this one's
just too weird. Thoughts?
%Ian
-
Ian F
plus one, seven oh seven, seven three seven, four twenty-one zero.
Big hitter, the Lama.
next reply other threads:[~2018-11-19 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 8:04 Ian F [this message]
2018-11-19 18:39 ` dana
2018-11-20 14:26 ` 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=CAMeu-1UHG4NvYW2gB4QFYoUAKbMgzFnz21QBXxACA5n7L7x8jA@mail.gmail.com \
--to=in4mer@gmail.com \
--cc=zsh-workers@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).