Shell calculator?

Addis

The King
I was trying to find a a calculator in bash? Anyone know if one exists, preferably a simple "eval 22 / 7" syntax.

I had to resort to writing a small C++ one, but I'm sure there must be a good one somewhere.
 
Another alternative if you're using bash (which you probably are) is something simple like

function calc() { echo $[$*]; }

Note, you can't have spaces in your expression, but that's not a big deal. use it like "calc 2*3**4" (note ** is the exponential operator, you can man bash for the others.)

*link removed*. Site Pimping is not allowed.
- RH
 
Back
Top