What are all the possible reasons that the shell would respond with "not found" when trying to run an executable?
- The executable definitely exists and has execute permission (
chmod +x
). ldd
indicates that all dependencies are present.- file indicates that the executable is compiled for the correct architecture (no reason why it shouldn't be, it's compiled along with the rest of the system in a Yocto build).
What other reasons could there be?
#! /path/to/bash
. Secondly what doestype -a bash
tell you. Also what are the permissions on the bash executable? What does yourecho $SHELL
tell you? – Valentin Bajrami Mar 04 '24 at 09:03#! /path/to/bash
" - I'm not sure what this means - this is not part of a shell script, just at the terminal.type -a bash
doesn't return anything (no error or other response).echo $SHELL
returns/bin/sh
.ls -l /bin/sh
returnslrwxrwxrwx 1 root root 23 Mar 4 2024 /bin/sh -> /usr/bin/busybox.nosuid
. Other executables work fine, it is just one in particular which is giving this problem. – Dane Mar 04 '24 at 09:11bash
installed in the system. I see this is abusybox
system which for obvious reasons does not include bash. So you are left to usesh
. – Valentin Bajrami Mar 04 '24 at 09:16ldd
, this doesn’t seem to be a shell script. – Stephen Kitt Mar 04 '24 at 09:17PATH
environment variable? – Kusalananda Mar 04 '24 at 09:24PATH
(the executable is in/sbin
) - running the executable directly makes no difference. – Dane Mar 04 '24 at 09:34