Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

bad interpreter: Operation not permitted on Lion 10.7.3

My unix scripts are now dead, after the upgrade to 10.7.3. A typical error message is /bin/bash: bad interpreter: Operation not permitted Googling this issue shows other people are having build scripts fail and are fixing this by renaming links to libraries. My scripts are simple, they just run an executable, or used to... something like this:

#! /bin/bash

./myprogram << EOF

$1

EOF

MacPlus, SE30, iMacG3, EmacG4, PB G4, iMacG5, PowerMacG5, iMac Intel, Mac OS X (10.7.2)

Posted on Feb 13, 2012 10:07 AM

Reply
72 replies

Oct 11, 2012 8:05 AM in response to galfenol

I could use some help with a similar error. I'm not a programmer. I installed VirtualBox, and decided to go with Parallels. When I double click VirtualBox_Uninstall.tool, I get:

Last login: Thu Oct 11 07:53:04 on console

/Volumes/VirtualBox/VirtualBox_Uninstall.tool ; exit;

davids-iMac:~ david seln$ /Volumes/VirtualBox/VirtualBox_Uninstall.tool ; exit;

-bash: /Volumes/VirtualBox/VirtualBox_Uninstall.tool: /bin/sh: bad interpreter: Operation not permitted

logout



[Process completed]


Any ideas?

Nov 2, 2012 6:08 PM in response to VikingOSX

VikingOSX wrote:


TextEdit is not a true code editor, and in your case, may add undesireable attributes to your code.


Pico, vi, vim, Sublime Text 2, Chocolate, Textmate, Xcode editor, and others treat code as code, hence your experience with Pico.

actually if you know how to use it.. it is a true text editor and will not add anything weird.


The errors here have nothing to do with the file itself, but Gatekeeper.

Nov 9, 2012 3:21 PM in response to anticro

anticro wrote:


All these answers are useless spam! The only thing that says what's really going on and a solution that works is described here:


http://stackoverflow.com/questions/9952612/mac-os-usr-bin-env-bad-interpreter-op eration-not-permitted


Short: run this command and you should be fine.

xattr -d com.apple.quarantine <YOUR FILE HERE>

thank u so mutch, your solution work and save my time, and of cource i completely agree with u: about 4 pages of useless spam

Apr 10, 2013 4:05 AM in response to galfenol

I had this problem too, appearing on 10.8.3


It appeared after I had some FS damage, I think due to VirtualBox creating a VDI badly. I repaired the FS and the permissions. After that I saw this error when trying to run scripts that I work on inside a HFS+ case sensitive disk image. The same problem was happening for very simple scripts I created after the problem started.


None of the suggestions I have read in this thread resolved the issue. What eventually resolved it for me was to create a new disk image, copy the files across, and then, for each script, to do:


cat script > new_script

rm script

chmod +x new_script

mv new_script script


Hours were wasted figuring out this problem.

bad interpreter: Operation not permitted on Lion 10.7.3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.