Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

arithmetic expression from outside



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



Messages sorted by: Reverse Date, Date, Thread, Author