Table of Contents#### Download Safari Books Online apps: Apple iOS | Android | BlackBerry

Entire Site

Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

There are two relatively recent additions to the bash shell that provide advanced features that you can use in if-then statements:

- Double parentheses for mathematical expressions
- Double square brackets for advanced string handling functions

The following sections describe each of these features in more detail.

Using Double Parentheses

The double parentheses command allows you to incorporate advanced mathematical formulas in your comparisons. The test command only allows for simple arithmetic operations in the comparison. The double parentheses command provides more mathematical symbols, which programmers, who have used other programming languages, may be used to using. The format of the double parentheses command is: