I want to run unity3d on my bash in order to put alias and .desktop entries. However, this proves to be more difficult.
The title error appears I try the command:
bash path/to/program
Searching through the site it seems to be a compatibility problem. So when I try the file command the output is:
program: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=8020f3d60eff5b41c53e6b60a9e2d43802e28f93, not stripped
while my system is x86_64.
However when I go directly to the folder and run the program as
./program
the program runs normally.
I don't see how that can be a compatibility problem with my system when I can run the program with ./program but not with bash program
As a note, I am using zsh and I am not sure if that interferes in any way.
Best Answer
When you do
bash some/file
, bash reads that file, parses its contents according to bash's syntax rules and executes the resulting commands. Valid files are usually called "scripts", and their contents are much like what you actually type out in a shell. Compiled programs contain machine instructions. You use zsh - do you expect it to understand machine instructions? Zsh doesn't, and neither does bash.If you want to use bash to execute a command, use the
-c
option:But there's not much point to doing so when the command itself is executable. If you can run it using
/some/command
, then use it directly.