Merge patch series "add [ as alias for test, fix 0/1 argument handling"

Rasmus Villemoes <ravi@prevas.dk> says:

Make 'test' behave a little more like its cousins in other shells, by
allowing the [ ... ] spelling, and while here, fix up the handling of
a single, non-empty argument to comply with POSIX.

Link: https://lore.kernel.org/r/20260312100106.702368-1-ravi@prevas.dk
This commit is contained in:
Tom Rini
2026-03-25 14:38:02 -06:00
3 changed files with 105 additions and 3 deletions

View File

@@ -20,11 +20,14 @@ Synopsis
test -e <interface> <dev[:part]> <path>
test <s> =~ <re>
[ <test expression> ]
Description
-----------
The ``test`` command is similar to the ordinary shell built-in by the
same name. Unlike in ordinary shells, it cannot be spelled ``[``.
same name. Like in ordinary shells, it can also be spelled ``[``,
provided the test expression is followed by a separate ``]`` argument.
Strings
~~~~~~~