[PATCH] tzselect.ksh: Use /bin/sh default shell interpreter
Adhemerval Zanella
adhemerval.zanella@linaro.org
Thu Dec 16 10:21:14 GMT 2021
On 16/12/2021 03:27, Paul Eggert wrote:
> On 12/15/21 21:52, Khem Raj wrote:
>> checkbashism reports no issues with tzselect.ksh, therefore using
>> /bin/sh instead of /bin/bash should be safe and portable across systems
>> which don't ship bash ( embedded systems )
>
> Didn't we already go through this? You proposed a better patch here:
>
> https://sourceware.org/pipermail/libc-alpha/2021-December/133938.html
>
> and I okayed it here:
>
> https://sourceware.org/pipermail/libc-alpha/2021-December/133940.html
I don't like this undocumented option that changes the installed script
through a Makefile variable. The worse part is when users start to use
we won't be able to properly remove unless we actually fix the tzselect
script.
>
>
> In contrast, the patch you just now emailed would change tzselect.ksh to just use /bin/sh. This would be an inferior patch because:
>
> (1) tzselect.ksh should be taken verbatim from upstream as Joseph mentioned <https://sourceware.org/pipermail/libc-alpha/2021-December/133559.html>.
>
> (2) tzselect.ksh has a better UI with Bash (or with ksh) than it does with a vanilla POSIX shell. It dynamically probes shell features and uses the Bash/ksh 'select' only if supported. Evidently this sort of dynamic probe is something that checkbashism is not smart enough to grok, so you shouldn't trust checkbashism on this script.
We are trying to avoid hard code bash on internal scripts so I think it
is a fair assumption that if user want to use tzselect properly as a
system tool it should use set bash or compatible shell as default.
More information about the Libc-alpha
mailing list