Do Math From The Command Line

Posted By Weston Ganger

I always have a terminal open and sometimes I need to add or multiply some values really quick. So I looked into it and made a bash function so I can do this. Add this to your .bashrc

math 4.2*6.5
math 56+34

### if using parenthesis be sure to wrap it as a string
math "127/(5*3)"

Hope this helps some of you. See the stack exchange link for more methods

Related External Links:

Article Topic:Software Development - Linux

Date:April 09, 2015