Re: [PATCH] tools: fix == bashism in kernel-chktaint
From: Thorsten Leemhuis
Date: Mon Oct 13 2025 - 02:53:05 EST
On 10/11/25 23:04, Kevin Locke wrote:
> When /bin/sh is a shell other than bash, invoking kernel-chktaint with
> at least one argument may produce error messages such as the following
> (produced by [dash] with argument 1024):
>
> ./kernel-chktaint: 22: [: 1024x: unexpected operator
> ./kernel-chktaint: 22: [: 1024x: unexpected operator
>
> This occurs because the == operator is not specified for [test in POSIX]
> and is not supported by all shells, as noted by shellcheck [SC3014].
>
> To fix the issue and avoid the error message, replace == with =.
Many thx for this!
Acked-by: Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
BTW, I doubt that anyone cares, but I wonder if these are really necessary:
> [dash]: https://git.kernel.org/pub/scm/utils/dash/dash.git
> [test in POSIX]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/test.html
> [SC3014]: https://www.shellcheck.net/wiki/SC3014
And maybe they should be proper link tags (with references at the end),
as mentioned in
https://www.kernel.org/doc/html/latest/process/5.Posting.html (search
for "optional-other-stuff"). But overall I guess those links are not
really worth it.
Ciao, Thorsten