add sum function

This commit is contained in:
Connor Olding 2019-12-27 16:00:29 -08:00
parent 48a0146e52
commit 9071e4b37d
1 changed files with 8 additions and 0 deletions

View File

@ -138,6 +138,14 @@ tw() {
twitch "$@" OMFG STFU &
}
sum() {
local sum=0
for i; do
sum=$((sum+i))
done
echo "$sum"
}
function {
local t="${TERM%%-*}"
if [ "$t" = xterm ] || [ "$t" = screen ] || [ "$t" = tmux ]; then