[PATCH v2 0/4] add [ as alias for test, fix 0/1 argument handling

Franz Schnyder fra.schnyder at gmail.com
Fri Mar 27 16:48:52 CET 2026


On Wed, Mar 25, 2026 at 05:05:59PM -0600, Tom Rini wrote:
> On Thu, 12 Mar 2026 11:01:02 +0100, Rasmus Villemoes wrote:
> 
> > 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.
> > 
> > v2: update documentation, add a few more test cases.
> > 
> > CI is happy: https://github.com/u-boot/u-boot/pull/905
> > 
> > [...]
> 
> Applied to u-boot/next, thanks!
> 
> [1/4] cmd: test: allow using [ as alias for test
>       commit: fc8bf9a984c118d551b3f93c66f1ae2733b9b588
> [2/4] doc: test: document [ ] spelling of test
>       commit: d44f61582947564991cce7501f2e5db0b29ebad6
> [3/4] test: add tests for left-bracket alias for 'test' command
>       commit: 6f9cc3310a764aaae4478b5a8a0c0cae3b2be4a1
> [4/4] cmd: test: fix handling of single-argument form of test
>       commit: 8b0619579b2282050e7fb0d92fbc645b79d18bae
> -- 
> Tom
> 
> 
Hello,

While preparing a patch series based on u-boot/next, I realised that 
the bootflow on our module broke.
I discovered that the issue was introduced with 
commit 8b0619579b2 ("cmd: test: fix handling of single-argument form of test")

This change breaks our boot script as it relies on the behaviour of test
with unquoted empty expansions. For example:

```
test -n ${m4boot} || env set m4boot ';'
```
Is now `test -n`, as there are no quotation marks. It now returns 
true, so the fallback assignment is skipped and it breaks our boot flow.

Any ideas? I think that we will not be the only ones affected by 
this once it's merged into master.
                                                                        
Best regards                                                            
                                                                        
Franz Schnyder     


More information about the U-Boot mailing list