Prepare calculations and chart results with Bash Math, Shell Style
Tutorials – Shell Math

While Bash is not the most advanced environment for doing and visualizing math, its power will surprise you. Learn how to calculate and display your results with shell scripts.
In this series' previous installments on Bash scripting [1, 2, 3, 4], I have explained how to use data structures, flow control commands, and testing operators. Now, I will show you how to handle number-related tasks with shell scripts.
Before getting started, I want to discuss the strengths and weaknesses of doing math inside shell scripts.
Bash cannot do floating-point math or plotting. As for speed, fast calculations of any kind have never been a selling point of Unix shells. When it comes to performance, there have been many, much better solutions since before C and Fortran. Today, with the right libraries, even other scripting languages are better choices if raw execution speed is your main requirement.
[...]
Buy this article as PDF
(incl. VAT)