On my current system, running FreeBSD 11.1-RELEASE-p3, does not seem to want to let me run shebang-less executable scripts, even though a freshly installed FreeBSD in a VM will do so (and I can run them just fine on my server, which is also running FreeBSD 11.1-RELEASE-p3).
I created a dummy script, named test.sh, with a single line of
However, my current system does not. If I try to run the script the same way with my current shell, csh, it tells me
I have been unable to determine why this is happening, I cannot find any sort of issue with my environment causing it. But, I have a theory that may or may not be the reason. I have emulators/qemu-user-static installed on my system, and when I do
I created a dummy script, named test.sh, with a single line of
echo "Hello world!"
in it. If I run the script on a working FreeBSD system with ./test.sh
, it correctly runs and outputs Hello world!
as expected.However, my current system does not. If I try to run the script the same way with my current shell, csh, it tells me
Command not found.
, whereas if I go into sh and do the same thing, it tells me not found
. If I run the script with sh ./test.sh
, it runs as expected.I have been unable to determine why this is happening, I cannot find any sort of issue with my environment causing it. But, I have a theory that may or may not be the reason. I have emulators/qemu-user-static installed on my system, and when I do
binmiscctl list
, along with the entries added by qemu-user-static's rc.d script, there is another entry with no name, no interpretter, set to enabled, with a magic size of 0, no magic and no mask. I don't get this inside a VM after installing qemu-user-static inside of it, so I don't know where this extra entry is coming from.