1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:39:03 -08:00
rc/sh/sum

14 lines
178 B
Bash

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