Name

let

Synopsis

                     let 
                     expressions
                  

Perform arithmetic as specified by one or more integer expressions. expressions consist of numbers, operators, and shell variables (which don’t need a preceding $), and must be quoted if they contain spaces or other special characters. For more information and examples, see Section 20.4. See also expr in Chapter 28.

Examples

Both of the following examples add 1 to variable i:

                     let i=i+1
                     let "i = i + 1"

Get Mac OS X Panther in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.