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 |
|
|
|
|
|
|
|
|
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access