Multiplication on command line terminal

The Solution to Multiplication on command line terminal is


Yes, you can use bash's built-in Arithmetic Expansion $(( )) to do some simple maths

$ echo "$((5 * 5))"
25

Check the Shell Arithmetic section in the Bash Reference Manual for a complete list of operators.

For sake of completeness, as other pointed out, if you need arbitrary precision, bc or dc would be better.

~ Answered on 2012-06-14 19:20:09


Most Viewed Questions: