Linux - Do math operations in shell
来源:互联网 发布:java定义构造方法 编辑:程序博客网 时间:2024/06/07 00:35
转自 http://doc.dev.md/lsst/
To do math operations in shell use "expr", syntax is as follows
Syntax: expr op1 operator op2
Syntax: expr op1 operator op2
Where, op1 and op2 are any Integer Number (Number without decimal point) and operator can be:
+ Addition
- Subtraction
/ Division
% Modular, to find remainder For e.g. 20 / 3 = 6 , to find remainder 20 % 3 = 2, (Remember its integer calculation)
\* Multiplication (注意要有反斜线)
Note: space is required between number and operator
0 0
- Linux - Do math operations in shell
- String Operations in Shell
- do-while in Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do all in cmd shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- Do All in Cmd Shell
- do all in cmd shell
- Do All in Cmd Shell
- do shell script in AppleScript
- user quota and lvm operations in linux
- [中文]Do All in Cmd Shell
- hibernate、spring、c3p0整合
- hibernate应用实例:hibernate validator 验证数据合法性
- Linux - Host key verification failed
- 入手便携DC(2014-1-26)
- 各大OJ题目分类
- Linux - Do math operations in shell
- 【备战蓝桥杯】USACO--> Milking Cows[1]
- 黑马程序员__java基础9 包 线程1
- centos和redhat6.0后关于虚拟机克隆后无法启用网卡问题
- Linux - Rules for Naming variable name
- 多线程的安全问题
- How to Install Oracle Java JDK on Ubuntu Linux
- STL中的常用的vector,map,set,Sort用法
- 2.1 python中的print和raw_input语句 [python入门教程]