by jph · 4y ago · 0 comments
Num is free open source software that uses `awk` to calculate many typical statistics on the command line.
echo "10 9 8" | perl -aMList::Util=/./ -E 'say min @F' # min
echo "10 9 8" | perl -aMList::Util=/./ -E 'say max @F' # max
echo "10 9 8" | perl -aMList::Util=/./ -E 'say sum @F' # sum
echo "10 9 8" | perl -aMList::Util=/./ -E 'say sum(@F)/@F' # average
echo "10 9 8" | perl -aMList::Util=/./ -E 'say reduce {"$a,$b"} @F' # arbitrary opsOr "I know how to package the `num` command for Linux (e.g. Ubuntu apt, Fedora yum) and BSD (e.g. FreeBSD pkg, macOS brew), and I'll do a few hours of volunteering to set up packaging, in order for users to be able to install more easily".