Shell calculator?

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.

There are two shell calculators that I know of that are standard GNU/Linux tools: expr and bc.

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.)

[COLOR=“Red”]link removed. Site Pimping is not allowed.

  • RH