From 90038bf9965f84a2959229a919e544874cdf4608 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 5 Mar 2022 17:40:40 -0800 Subject: [PATCH] allow numbers to end with a comma in the sum command makes it easier to paste stuff into the terminal --- sh/sum | 1 + 1 file changed, 1 insertion(+) diff --git a/sh/sum b/sh/sum index 24f7937..cc26777 100755 --- a/sh/sum +++ b/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"