zsh-workers
 help / color / mirror / code / Atom feed
From: YAMAGUCHI Takanori <t-yama@iij.ad.jp>
To: zsh-workers@zsh.org
Subject: arithmetic expression from outside
Date: Thu, 5 Sep 2019 17:49:31 +0900	[thread overview]
Message-ID: <69f3c9f0-b91b-beb1-d36c-854bb4eb3ff3@iij.ad.jp> (raw)

Is this an intended behaviour?

% cat sum.sh
sum=0
while read n; do
  sum=$((sum+n))
done
echo $sum
% seq 10 | zsh sum.sh
55
% yes ++sum | head -10 | zsh sum.sh
2046
% echo 'sum[$(echo Hello, world!>&2)]' | zsh sum.sh
Hello, world!
sum.sh:3: bad math expression: empty string
% zsh -c 'echo $ZSH_VERSION'
5.5.1

             reply	other threads:[~2019-09-05  8:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  8:49 YAMAGUCHI Takanori [this message]
2019-09-05 18:22 ` Bart Schaefer
2019-09-05 19:49   ` Stephane Chazelas
2019-09-06  5:48   ` YAMAGUCHI Takanori
2019-09-07 12:01   ` Daniel Shahaf

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=69f3c9f0-b91b-beb1-d36c-854bb4eb3ff3@iij.ad.jp \
    --to=t-yama@iij.ad.jp \
    --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).