Quick Answer: How Do You Divide in Unix?
Contents

How do you split two numbers in Unix?

Shell script for division of two numbers

  1. initialize two variables.
  2. divide two numbers directly using $(…) or by using external program expr.
  3. Echo the final result.

How do you split in Shell?

The following arithmetic operators are supported by Bourne Shell.
…
Unix / Linux – Shell Arithmetic Operators Example.

Operator Description Example
/ (Division) Divides left hand operand by right hand operand `expr $b / $a` will give 2
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest