1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-04-30 10:53:23 -07:00

add sum function

This commit is contained in:
Connor Olding 2019-12-27 16:00:29 -08:00
parent 48a0146e52
commit 9071e4b37d

View File

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