Math operator in a Shell Script

Operators

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
posted @   ordi  阅读(194)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示