[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Conditional expressions are used by the [[
compound command
and the test
and [
builtin commands.
Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. There are string operators and numeric comparison operators as well. If the file argument to one of the primaries is of the form `/dev/fd/N', then file descriptor N is checked. If the file argument to one of the primaries is one of `/dev/stdin', `/dev/stdout', or `/dev/stderr', file descriptor 0, 1, or 2, respectively, is checked.
-a file
-b file
-c file
-d file
-e file
-f file
-g file
-h file
-k file
-p file
-r file
-s file
-t fd
-u file
-w file
-x file
-O file
-G file
-L file
-S file
-N file
file1 -nt file2
file1 -ot file2
file1 -ef file2
-o optname
set
builtin (see section 4.3 The Set Builtin).
-z string
-n string
string
string1 == string2
string1 != string2
string1 < string2
string1 > string2
arg1 OP arg2
OP
is one of
`-eq', `-ne', `-lt', `-le', `-gt', or `-ge'.
These arithmetic binary operators return true if arg1
is equal to, not equal to, less than, less than or equal to,
greater than, or greater than or equal to arg2,
respectively. Arg1 and arg2
may be positive or negative integers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |