**Table 15-7. Logical Operators**

Example | Name | Result |
---|---|---|

$a and $b | And | if both $a and $b are TRUE.TRUE |

$a or $b | Or | if either $a or $b is TRUE.TRUE |

$a xor $b | Xor | if either $a or $b is TRUE, but not both.TRUE |

! $a | Not | if $a is not TRUE.TRUE |

$a && $b | And | if both $a and $b are TRUE.TRUE |

$a || $b | Or | if either $a or $b is TRUE.TRUE |

The reason for the two different variations of "and" and "or" operators is that they operate at different precedences. (See Operator Precedence.)