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


Linux in a NutshellLinux in a NutshellSearch this book

7.4. Arithmetic Expressions

The let command performs integer arithmetic. bash provides a way to substitute integer values (for use as command arguments or in variables); base conversion is also possible.

Expression

Meaning

(( expr))

Use the value of the enclosed arithmetic expression.

7.4.2. Examples

See the let built-in command for more information and examples.

let "count=0" "i = i + 1"      Assign i and count
let "num % 2"; echo $?               Test for an even number


Library Navigation Links

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