A most bizarre experience that I cannot explain and has me pulling my hair out. I have a binary executable file MMM and it exists, I can see it it has the x permission set, bash even autocompletes the name when I press the TAB key and file confirms its executable but this happens:
~/tmp$ ls -l
total 56
-rwxrwxr-x 1 polyphemus polyphemus 56948 Jun 25 22:43 MMM
~/tmp$ file MMM
MMM: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.2.5, stripped
~/tmp$ ./MMM
-bash: ./MMM: No such file or directory
So I copied this file from another server, and to make sure I haven't got some strange file corruption going on, not that that would explain bash's ridiculous claim the file does not exist, I copied the file to a NAS and from the NAS back to another server and repeated exactly the same experiment, only this happens:
~/tmp$ ls -l
total 56
-rwxr-xr-x 1 bernd bernd 56948 Jun 25 22:53 MMM
~/tmp$ file MMM
MMM: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.2.5, stripped
~/tmp$ ./MMM
JAVA_HOME is not set. ./MMM cannot start.
if it helps they are both Linux Mint boxes, the one where it works is a development machine with Mint 19 and the one where it's not working is a fresh install of Mint 19.1.
The install works fine, other executables run fine and I can run then in bash with ./file.
I've studied and compared the shopts and found nothing, the aliases and found nothing. This has me pulling my hair out. I hope someone has seen this before.