Contents
| +, – | Addition, subtraction |
|---|---|
| *, / , % | Multiplication, division, remainder |
| ** | Exponent value |
How do you multiply two numbers in Linux?
Shell script for multiplication of two numbers
- initialize two variables.
- multiply two numbers directly using $(…) or by using external program expr.
- Echo the final result.
How do you do math on Linux?
5 Useful Ways to Do Arithmetic in Linux Terminal
- Using Bash Shell. The first and easiest way do basic math on the Linux CLI is a using double parenthesis. …
- Using expr Command. The expr command evaluates expressions and prints the value of provided expression to standard output. …
- Using bc Command. …
- Using Awk Command. …
- Using factor Command.
9 янв. 2019 г.