test, [ ... ] |
---|
|
test [ expression ] [ [ expression ] ] |
---|
|
To test conditions in shell scripts, returning results via the exit status. Note that in the second form of the command, the brackets are typed literally, and must be separated from the enclosed expression by whitespace. |
---|
|
See Table 6-6 and text. |
---|
|
test tests file attributes, compares strings, and compares numbers. |
---|
|
The expressions mandated by POSIX are a subset of what is often available on real systems. Care is required for full portability. More information is provided in Section 14.3.2. |
---|
Except on absolutely ancient Unix systems, test is built into the shell. Since built-in commands are found before external commands, this makes it difficult to write simple test programs that produce an executable named test. Such programs must be invoked as ./test (assuming they're in the current directory). |
---|