- 论坛徽章:
- 145
|
回复 1# 魔鬼的惊叹
$ man bash
NAME
bash - GNU Bourne-Again SHell
...
CONDITIONAL EXPRESSIONS
Conditional expressions are used by the [[ compound command and the
test and [ builtin commands to test file attributes and perform string
and arithmetic comparisons. Expressions are formed from the following
unary or binary primaries. If any file argument to one of the pri‐
maries 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.
...
string1 == string2
string1 = string2
True if the strings are equal. = should be used with the test
command for POSIX conformance.
string1 != string2
True if the strings are not equal.
|
|