Summary
In this chapter, I’ve shown you several ways to perform math operations in bash
, and even provided a couple of tips on how to ensure that your math scripts can run on non-bash
shells. I started with the various methods of performing integer math, and then showed you various ways to use bc
to perform floating point math. As I said before, you’d need to be a math expert to take full advantage of all of bc
's features. But, even if you aren’t, there’s still a lot you can do with it. And, there are plenty of math tutorials online that can help. Just use your favorite search engine to find them.
In the next chapter, I’ll show you how to use here documents. I’ll see you there.