How do I divide in the Linux console?

后端 未结 12 1983
情话喂你
情话喂你 2020-12-25 10:41

I have to variables and I want to find the value of one divided by the other. What commands should I use to do this?

12条回答
  •  时光取名叫无心
    2020-12-25 11:20

    In bash, if you don't need decimals in your division, you can do:

    >echo $((5+6))
    11
    >echo $((10/2))
    5
    >echo $((10/3))
    3
    

提交回复
热议问题