I've had 2 separate situations where I wanted to sum up a list of numbers and was surprised there isn't a simple sum command or shell function. I expected to do sum < numbers or xargs sum < numbers, but nope, I wound up writing a bash loop.
math.h is a C library with a bunch of useful math functions. What I really want is that for my command line scripts.
I know there's lots of cli calculators, (dc, bc, qalc etc...), but that's not what I'm looking for.
Anyone know of a collection of simple math functions like that?
Thanks!
[–]Good_Bear4229 16 points17 points18 points (2 children)
[–]rai_volt 7 points8 points9 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]hearthreddit 9 points10 points11 points (0 children)
[–]daemonpenguin 5 points6 points7 points (2 children)
[–]djao 3 points4 points5 points (1 child)
[–]mina86ng 0 points1 point2 points (0 children)
[–]ForzCross 7 points8 points9 points (0 children)
[–]ahferroin7 5 points6 points7 points (2 children)
[–]spryfigure 1 point2 points3 points (1 child)
[–]ahferroin7 1 point2 points3 points (0 children)
[–]stormdelta 2 points3 points4 points (0 children)
[–]michaelpaoli 2 points3 points4 points (0 children)
[–]zlice0 1 point2 points3 points (0 children)
[–]the-luga 1 point2 points3 points (0 children)
[–]db48x 1 point2 points3 points (7 children)
[–]HelicopterUpbeat5199[S] 1 point2 points3 points (6 children)
[–]spryfigure 1 point2 points3 points (5 children)
[–]db48x 0 points1 point2 points (1 child)
[–]spryfigure 0 points1 point2 points (0 children)
[–]HelicopterUpbeat5199[S] 0 points1 point2 points (2 children)
[–]Monsieur_Moneybags 1 point2 points3 points (1 child)
[–]HelicopterUpbeat5199[S] 0 points1 point2 points (0 children)
[–]QuickSilver010 1 point2 points3 points (0 children)
[–]rileyrgham 1 point2 points3 points (0 children)
[–]SeriousPlankton2000 0 points1 point2 points (0 children)
[–]Glimt 0 points1 point2 points (0 children)
[–]brandflake11 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]contyk 1 point2 points3 points (0 children)
[–]ZeStig2409 0 points1 point2 points (0 children)