In Ubuntu if is executed the man test command appears the following:
TEST(1) User Commands TEST(1)
NAME
test - check file types and compare values
SYNOPSIS
test EXPRESSION
test
[ EXPRESSION ]
[ ]
[ OPTION
DESCRIPTION
Exit with the status determined by EXPRESSION.
...
Observe the following part:
SYNOPSIS
test EXPRESSION
test
[ EXPRESSION ]
[ ]
[ OPTION <-----
Is [ OPTION an error? It should be [ OPTION ] right?
Conditional expressions are used by the [[ compound command (see Conditional Constructs) and the test and [ builtin commands (see Bourne Shell Builtins). The test and [ commands determine their behavior based on the number of arguments; see the descriptions of those commands for any other command-specific actions."
I cant find any examples.
[ seems to be a synonym for test … ie you can use [ anywhere you can use the word test
IDK the fine points of it, but “[” is like an alias for “test”. It does not use the “]” for anything, not even parsing, AFAIK, but bash requires it or issues a syntax error.
it is documented in the bash man page because it is part of bash.
Interesting … I’ve confirmed the man bash command works … but exactly where is “test” included in the mentioned command?
Do you mean about
EXECIGNORE
A colon-separated list of shell patterns (see Pattern Matching) defining the list of filenames to be ignored by command search us‐
ing PATH. Files whose full pathnames match one of these patterns are not considered executable files for the purposes of comple‐
tion and command execution via PATH lookup. This does not affect the behavior of the [, test, and [[ commands. Full pathnames in
the command hash table are not subject to EXECIGNORE. Use this variable to ignore shared library files that have the executable
bit set, but are not executable files. The pattern matching honors the setting of the extglob shell option.
FCEDIT The default editor for the fc builtin command.
It about the This does not affect the behavior of the [, test, and [[ commands part?
Futhermore appears
test and [ evaluate conditional expressions using a set of rules based on the number of arguments.