added sum function to shellscript version

This commit is contained in:
Atlas Cove 2023-09-30 16:30:56 +01:00
parent 25ea50ae8a
commit 10ab8da848

View File

@ -8,3 +8,9 @@ function mul { echo $(($1*$2)); }
function div { echo $(($1/$2)); }
function mdl { echo $(($1%$2)); }
function randr { echo $(($1+$RANDOM%$2)); }
function sum {
for i in $@; do
acc=$((acc+i))
done
echo $acc
}