[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
arithmetic expression from outside
From: |
YAMAGUCHI Takanori |
Subject: |
arithmetic expression from outside |
Date: |
Thu, 5 Sep 2019 17:40:48 +0900 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
Is this an intended behaviour?
% cat sum.sh
sum=0
while read n; do
sum=$((sum+n))
done
echo $sum
% seq 10 | bash sum.sh
55
% yes ++sum | head -10 | bash sum.sh
1023
% echo 'x[$(echo Hello, world!>&2)]' | bash sum.sh
Hello, world!
0
% bash -c 'echo $BASH_VERSION'
5.0.9(0)-release
- arithmetic expression from outside,
YAMAGUCHI Takanori <=