linux 脚本里计算加减乘除

linux下面计算加减乘除,其实也就是一个小程序,名字是”expr”。这个程序很好用,不过有一点需要注意,就是不要忘了使用空格和转义,比如计算两个数的乘法,应该这样写:

  • expr 1024 \* 1024

其实还是很简单的,这儿有份不错的参考文档,这个程序可不光能计算加减乘除哦,很多表达式,他都可以计算出结果。
expr 命令:http://study.chyangwa.com/IT/AIX/aixcmds2/expr.htm

About 王永杰

路漫漫其修远兮,吾将上下而求索
This entry was posted in linux应用, 技术为本. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>