首页 > 其他 > 详细

bash arithmatic

时间:2014-07-11 22:32:54      阅读:426      评论:0      收藏:0      [点我收藏+]
Arithmetic in bash is done with $ and double parentheses:

echo "$(($num1+$num2))"
Or $ and square brackets:

echo "$[$num1+$num2]"
You can assign from that (sans echo). There is also expr:

echo `expr "$num1" + "$num2"`

  http://unix.stackexchange.com/a/93030

bash arithmatic,布布扣,bubuko.com

bash arithmatic

原文:http://www.cnblogs.com/long123king/p/3833046.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!