Operator | Meaning |
---|---|
( ) | change precedence |
~ | 1`s complement |
! | logical negation |
* / % | multiply, divide, modulo |
+ - | add, subtract |
<< >> | left shift, right shift |
== != | string comparison |
=~ !~ | pattern matching (BSD) |
& | bitwise "and" |
^ | bitwise "exclusive or" |
| | bitwise "inclusive or" |
&& | logical "and" |
|| | logical "or" |
Operator | Meaning |
---|---|
++ | increment |
-- | decrement |
= | assignment |
*= | multiply left side by right side and update left side |
/= | divide left side by right side and update left side |
+= | add left side to right side and update left side |
-= | subtract left side from right side and update left side |
^= | "exclusive or" left side to right side and update left side |
%= | (modulo) divide left by right side and update left side with remainder |
Format: (operator filename)
Operator | True if |
---|---|
-d | file is a directory |
-e | file exists |
-f | file is a plain file |
-o | user is owner |
-r | user has read access |
-w | user has write access |
-x | user has execute access |
-z | file has zero length |