How to solve: -bash: : cannot execute binary file
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island
--
Chapters
00:00 How To Solve: -Bash: : Cannot Execute Binary File
01:03 Accepted Answer Score 31
02:39 Answer 2 Score 1
02:51 Thank you
--
Full question
https://superuser.com/questions/724301/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#macos #bash #binaryfiles
#avk47
ACCEPTED ANSWER
Score 31
Sorry, this file is for GNU/Linux
According to your file
output, this program is for GNU/Linux. I know this because:
- The file
b1
is in theELF
(Extensible and Linkable Format) format, while Mac OS X uses theMach-O
format for binaries; file
recognizes this file is forGNU/Linux 2.6.18
, meaning it'll work on most modern Linux distributions.
To solve your problem, you must either run this problem within a Linux distribution, recompile the program, or get the Mac OS X version of this program.
So... Why doesn't b1
work on XYZ OS or CPU?
Just as people speak different languages, different computers understand different instructions. For instance, your Mac uses an Intel processor, while your Android phone uses an ARM processor. Compare these two processors to English and French. They may belong to the same language family, but still, you can't speak both at the same time. This leads to a conclusion:
Dissimilar computers "talk" in different tongues.
As for why different operating systems (such as Windows, Mac OS X, and Linux) can't use the same binaries, consider this:
What makes software objectively different to hardware? Not much.
Both provide a system and a "language" that allows for more complex components of the computer to complete tasks for the end user. Both require an agreed language to get work done. Imagine if there were 10 people in a shouting match, each speaking a different language. This is why different OS software need different binaries, even if both operating systems use the same processor.
ANSWER 2
Score 1
assembly language? You need to compile it, or rather assemble it.
man as