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
.