home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeBook TitleSearch this book

5.4. Expressions

Expressions are used in @ (the C shell math operator), if, and while statements to perform arithmetic, string comparisons, file testing, etc. exit and set can also specify expressions. Expressions are formed by combining variables and constants with operators that resemble those in the C programming language. Operator precedence is the same as in C. It is easiest to just remember the following precedence rules:

  • * / %

  • + -

  • Group all other expressions inside () s; parentheses are required if the expression contains <, <, &, or |

5.4.1. Operators

Operators can be one of the following types.

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.