It’s also possible to combine expressions to create more complex evaluations. Expressions are combined by using logical operators. We saw these in Chapter 17, when we learned about the find command. There are three logical operations for test and
[[ ]]. They are AND, OR, and NOT.
[[ ]] use different operators to represent these operations, as shown in Table 27-4.
Table 27-4. Logical Operators
[[ ]] and (( ))
Here’s an example of an AND operation. The following script determines if an integer is within a range of values:
#!/bin/bash # test-integer3: determine if an integer is within a # specified range of values. MIN_VAL=1 MAX_VAL=100 INT=50 if [[ "$INT" =˜ ^-?[0-9]+$ ]]; then if [[ INT ...