Test Operators
The operators in Test Operators are used with
test and the […] and [[…]] constructs. They can be
logically combined with -a
(“and”) and
-o
(“or”) and grouped with escaped parenthesis (\(…\)). The string
comparisons < and > and the [[…]] construct are not available in
versions of bash prior to 2.0, and =~ is only
available in bash version 3.0 and later as
noted.
Table A-9. Test operators
Operator | True if |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| File descriptor N points to a terminal |
|
|
|
|
|
|
|
|
|
|
Get bash Cookbook 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.