mirror of
https://github.com/notwa/rc
synced 2025-01-06 11:58:06 -08: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:
parent
7d895d20a7
commit
90038bf996
1 changed files with 1 additions and 0 deletions
1
sh/sum
1
sh/sum
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue