#!/bin/sh # The Korn-style arithmetic builtins: typeset -i and let, with $(( )) # for the value. (( )) as a command is ksh93, not ksh88, so it has its # own benchmark (dparen.sh). Shells without these are reported as n/a. # shellcheck disable=SC2034 # the probe only has to assign an integer ( typeset -i p=1 ) 2>/dev/null || exit 3 typeset -i n=0 i=0 sum=0 while [ $i -lt 200000 ]; do sum=$((sum + (i % 100) * 2)) let "i = i + 1" n=n+1 done echo "$i $sum $n"