9.9 Control Commands
(...) group expressions with ()
~ inversion (one's complement)
! logical negation
*, /, % multiply, divide, modulus
+, - add, subtract
<<, >> bitwise shift left, bitwise shift right
<= less than or equal
>= greater than or equal
< less than
> greater than
== equal
!= not equal
=~ match a string
!~ don't match the string
& bitwise AND
^ bitwise XOR (exclusive or)
| bitwise OR
&& logical AND
|| logical OR
{command} true (1) if command terminates with a zero exit status, false (0) otherwise.
The C shell also allows file type and permission inquiries with the operators:
-r return true (1) if it exists and is readable, otherwise return false (0)
-w true if it exists and is writable
-x true if it exists and is executable
-f true if it exists and is a regular file (or for csh, exists and is not a directory)
-d true if it exists and is a directory
-e true if the file exists
-o true if the user owns the file
-z true if the file has zero length (empty)