Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 445 Bytes

math.md

File metadata and controls

17 lines (12 loc) · 445 Bytes

Doing math in bash

Doing math in bash is easy when you know how. Lets see...

some_number=$((10 * 100))

Done! The variable some_number will produce 1,000. We done this by wrapping our math in $(())! Cool eh! What happens if you wanted to calculate something first well it's just like using a sum formula in Excel

math=$(((10 * 100) + 100))

The above calculates the 10 * 100 first before adding the 100 to it.