summaryrefslogtreecommitdiffhomepage
path: root/bench/dparen.sh
blob: 99a2b2c2ab22b4c4af700934782d690f46a2ba93 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# (( )) as a command, which ksh93 has and ksh88 does not (ksh88 has let
# and $(( ))).  Shells without it are reported as n/a.
( ((1)) ) 2>/dev/null || exit 3
i=0
sum=0
while ((i < 200000)); do
    ((sum += (i % 100) * 2))
    ((i += 1))
done
echo "$i $sum"