/bin/bash: cannot excute binary file
I was changing paths and I think I screwed up. My terminal shows
"/bin/bash: /bin/bash: cannot execute binary file"
when it opens
Help?
MacBook Pro, Mac OS X (10.6.8)
I was changing paths and I think I screwed up. My terminal shows
"/bin/bash: /bin/bash: cannot execute binary file"
when it opens
Help?
MacBook Pro, Mac OS X (10.6.8)
Nice, it worked thanks!
it worked! Thanks!
Hmmm, so would it be better if I reinstalled /bin and not just /bin/bash?
Hmm 3 posts in this thread while I was constucting mine...
I guess to avoid a full install maybe just sample some of the stuff in /bin with the file command. If you find others that are classed as just data I would be leary of the entire OS install, not just /bin. You could do a full reinstall to be sure but that's potentially painfull if you have some of your own stuff on the boot. Or I guess you can just not worry and when you encounter some other command that isn't executable, since you now know what to look for, replace it like the bash.
It's a tough call and your decision. I guess I would just first sample other random /bin files to see if they are still executable. If bash is the only one that was screwed leave everything else alone for now.
Well, I'm pretty sure I only screwed around with /bin . So it shoudl be okay to reinstall /bin from pacifist instead of just /bin/bash right?
I suppose. But if you reinstalled bash with pacifist just quit while you're ahead 😉 Leave it alone for now. You can always do the restore of the entire /bin if you have future problems with the stuff in there. And if that doesn't work, bite the bullet, reinstall.
It's a shame you don't have any backups of your system you could fall back on (I don't recall you mentioning that). I always have two - one online backup updated daily (I don't use time machine) and one offline (backed up less frequently). I also don't keep my home dir on the boot volume and it too has online/offline backups.
One other thing to check is the script's file type.
running a "file" on my script file named CollectForOutput returned:
file ./CollectForOutput
CollectForOutput: Little-endian UTF-16 Unicode text
...I was getting the "cannot execute binary file" error from bash because the file encoding was UTF-16.
Re-ouputting the file using ASCII encoding fixed everything... file returned:
file ./CollectForOutput
CollectForOutput: Bourne-Again shell script text executable
... then I was able to double click to run the script.
I didn't check if UTF-8 or any of the other encodings worked... ASCII worked so I'm just running with it.
Your text editor should allow you to set the file encoding to ASCII during save.
/bin/bash: cannot excute binary file