The kode sumber menjelaskan perbedaan sebagai bagaimana menangani --help
pilihan.
/* Recognize --help or --version, but only when invoked in the
"[" form, when the last argument is not "]". Use direct
parsing, rather than parse_long_options, to avoid accepting
abbreviations. POSIX allows "[ --help" and "[ --version" to
have the usual GNU behavior, but it requires "test --help"
and "test --version" to exit silently with status 0. */
Peragaan
$ /usr/bin/test --help
$
$ /usr/bin/[ --help
Usage: test EXPRESSION
or: test
or: [ EXPRESSION ]
or: [ ]
or: [ OPTION
Exit with the status determined by EXPRESSION.
[...]
Dalam bash
versi bawaan, satu-satunya perbedaan adalah yang [
membutuhkan ]
di akhir, seperti yang Anda katakan.