标签:
The shells use arithmetic operators from the C programming language, in decreasing order of precedence.Math Operators
| OPERATOR | DESCRIPTION |
| ++ −− < /editor query > | Auto-increment and auto-decrement, both prefix and postfix |
| + | Unary plus |
| − | Unary minus |
| ! ~ | Logical negation; binary inversion (one‘s complement) |
| * / % | Multiplication; division; modulus (remainder) |
| + − | Addition; subtraction |
| << >> | Bitwise left shift; bitwise right shift |
| <= >= | Less than or equal to; greater than or equal to |
| < > | Less than; greater than |
| == != | Equality; inequality (both evaluated left to right) |
| & | Bitwise AND |
| ^ | Bitwise exclusive OR |
| | | Bitwise OR |
| && | Logical AND |
| || | Logical OR |
Math operator in a Shell Script
标签:
原文地址:http://www.cnblogs.com/ordili/p/5916035.html