I noticed while answering another question that test
and [
are different binaries, but the [
manpage pulls up test
's. Besides the requirement for an ending ]
, is there any difference? If not, why are they separate binaries instead of being symlinked? (They are also bash
builtins, and bash
doesn't show a difference either.)
Linux Command Line – Differences Between `test` and `[` Binaries
command linecoreutilslinuxtestUtilities
Best Answer
The source code explains the difference as being how it handles the
--help
option.Demonstrating
In the
bash
builtin version, the only difference is that[
requires]
at the end, as you said.