1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 02:39:03 -08:00
rc/sh/sum
2021-07-29 00:37:35 -07:00

12 lines
157 B
Bash

#!/usr/bin/env sh
# YES_ZSH
sum() {
local sum=0
for i; do
sum=$((sum+i))
done
echo "$sum"
}
[ "${SOURCING:-0}" -gt 0 ] || sum "$@"