Is the "bash" shell installed on the Home Assistant OS host, or only basic "sh" shell?

I have SSH’d into the HAOS host (using developer port 22222), to bring up a command line terminal. I am confused as to whether bash is installed or not.

I try to run the following script ./testscript.sh :

#!/usr/bin/env bash

echo "$BASH_VERSION"

which just seems to be empty.

I have also tried with the following different shebangs at the top of the script, to ensure it is run by the bash shell rather than the standard "sh" shell:

#!/usr/bin/env bash
#!/bin/bash
#!/usr/bin/bash

I can see that there indeed seems to be a bash file here:

# ls -ltr /bin/ | grep bash
-rwxr-xr-x    1 root     root         14256 Dec 19 11:40 bash

as well as here:

ls -ltr /usr/bin/ | grep bash
-rwxr-xr-x    1 root     root         14256 Dec 19 11:40 bash

However, when I look at the installed shells list, then bash appears to be missing:

# cat /etc/shells
/bin/ash
/bin/sh

I can see that the default shell for the HAOS root user is indeed the basic "sh" shell by examining the /etc/passwd file:

# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/sh

but I don’t understand whether bash itself is installed or not. As I say, the bash executables appear to be present, but I’m not able to even obtain the version number with bash --version.

I find from time to time that HAOS’s linux shell/commands are not always built with full capabilities, so it could be the case that HAOS’s bash is a skinnier version. Having said that, the general practice is to not run shell scripts and the like directly on HAOS.

I know it “could be the case”. Thats why my question arose. I am trying to ascertain what actually is the case.

Can anyone help with that?

Why are there hints that bash is installed, but I am not actually able to run any scripts with bash?

I know I still can’t answer your question, but looking at the following buildroot config is about as good as I can figure out. It appears that HAOS is built with gnu bash using version 5.2.21

Why one can’t use the bash shell to show things like what its versioning is what I still can’t figure out.

Yes I was poking around in the buildroot configs as well, and it seemed to point to the fact that recent versions of bash should be installed. I am running the .qcow2 version of the HASS OS, so I’m not exactly sure where to look to find the buildroot config for this exact version?

(For context, I was trying to write a bash script which uses the readarray function, which should be in bash versions 4 and later. But I was receiving errors that the function isn’t found.)