On Fri, Jan 15 2021, Ævar Arnfjörð Bjarmason wrote:
+TEST_SH_IS_BIN_BASH=
+if test -n "$BASH" && test -z "$POSIXLY_CORRECT"
+then
+ TEST_SH_IS_BIN_BASH=true
+ export TEST_SH_IS_BIN_BASH
+fi
I haven't been able to find from bash's documentation & sources whether
this really is the right thing here. I.e. in test-lib.sh we've got an
existing test for checking $BASH_VERSION. As far as I can tell it's not
documented, but that variable doesn't appear in bash's /bin/sh mode,
just in /bin/bash mode.
And then there's $POSIXLY_CORRECT, does that make it 2 modes in total,
or 4 (or 3)? I didn't look too carefully, and in any case this worked
for all the cases I threw at it of running the tests with /bin/sh or
/bin/bash, but it would be a nice follow-up patch to unify this & the
other $BASH_VERSION check in test-lib.sh if we could...