1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-03 04:03:24 -07:00

allow numbers to end with a comma in the sum command

makes it easier to paste stuff into the terminal
This commit is contained in:
Connor Olding 2022-03-05 17:40:40 -08:00
parent 7d895d20a7
commit 90038bf996

1
sh/sum
View File

@ -16,6 +16,7 @@ sum() { ### @-
### **TODO:** consider renaming because sum(1) already exists.
local sum=0
for i; do
i="${i%,}"
: $((sum+=i))
done
echo "$sum"