1 2 3 4 5 Previous Next 71 Replies Latest reply: Apr 10, 2013 4:05 AM by mikeamy Go to original post
  • 45. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    infobleep Level 1 Level 1 (10 points)

    Is this the sort of bug Apple are likely to fix? Or are bugs like this not considered that important. After all it's only affecting people accessing Unix or doing things above and beyond web browsing; sending e-mail and watching TV/videos and listening to music.

     

    I came across the bug tonight when trying to do something with EXIFTOOL, having previously modified my script in textedit, as I do from time to time.

     

    I created a brand new file to try and avoid this and then I did the following:

    sudo chmod 7777 'name of file' in terminal. However that then simply caused the Operation not permitted error when I then tried to run the script.

     

    A quick and simple task then takes over an hour as I read up on the issue and read the different ways of trying to avoid it or get round it.

     

    I don't do much script writing so I don't see the point of a delicated script editor but I may have no choice if I want an easier life for the time being,

     

    I did wonder what else I've quarantined without realising . I guess it doesn't matter until I hit a problem accessing a file or doing anything with it.

     

    Kind regards

  • 46. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    BobHarris Level 6 Level 6 (13,120 points)

    Maybe if someone (or a lot of people) report it to Apple

     

    BugReporter

    <http://bugreporter.apple.com>

    Free ADC (Apple Developer Connection) account needed for BugReporter.

    Anyone can get a free account at:

    <http://developer.apple.com/programs/register/>

     

    And/Or

     

    Mac OS X Feedback

    <http://www.apple.com/feedback/macosx.html>

  • 47. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    etresoft Level 7 Level 7 (24,270 points)

    infobleep wrote:

     

    Is this the sort of bug Apple are likely to fix?

    No, because the problem caused by some software or configuration on your machine. I have been using MacOS X since the "beta" days and I have never seen this problem. It is quite rare that I don't have a Terminal running.

  • 48. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    doh1231 Level 2 Level 2 (210 points)

    I just ran into this problem too... only happens with TextEdit and I've used it for years to edit scripts.  I doubt its just some fluke with our machines since I can reproduce it with a default fresh OSX install as well... perhaps something on your machine is working around it without you knowing about it.

  • 49. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    anthon9969 Level 1 Level 1 (0 points)

    I just figured out why i was getting the output -bash: ./hello.sh: bin/bash: bad interpreter: Operation not permitted when trying to compile a simple script Hello World.

     

    To fix it i had to go to the TextEdit file that I saved as hello.sh and right click, select Get Info and go to select Open with drop down menu and choose and select Open with: TextEdit.

     

    The script run perfectly afterwards.

     

    Please let me know if this also worked for you? If not I can try and advise further.

  • 50. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    doh1231 Level 2 Level 2 (210 points)

    yeah... this is something to do with the changes for Gatekeeper I think.  I noticed if I save and double click to run files from TextEdit I've gotten prompts saying "TextEdit downloaded this from the internet, are you sure you want to run it" stuff... I'm like... no I just wrote that, it wasn't downloaded... but it doesn't do it all the time.

  • 51. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    etresoft Level 7 Level 7 (24,270 points)

    doh1231 wrote:

     

    I just ran into this problem too... only happens with TextEdit and I've used it for years to edit scripts.

    Don't do that. TextEdit is for documents, not UNIX scripts.

     

    yeah... this is something to do with the changes for Gatekeeper I think.  I noticed if I save and double click to run files from TextEdit I've gotten prompts saying "TextEdit downloaded this from the internet, are you sure you want to run it" stuff... I'm like... no I just wrote that, it wasn't downloaded... but it doesn't do it all the time.

    It has nothing to do with Gatekeeper. That is only in Mountain Lion. If you are working with UNIX scripts, you don't use TextEdit and you don't double-click.

  • 52. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    doh1231 Level 2 Level 2 (210 points)

    First, don't push your preferences on other people like its some type of right or wrong.  I've done quick editing of simple scripts in TextEdit for many years and its never been a problem.... its a text editor after all.  Just because you do not like doing that, or it has some features to do more than that doesn't mean it cannot do that.  I was adding what I've seen and what is the issue, not asking for anyone's opinion if its the way things should be done.

     

    And yes Gatekeeper is on 10.7.3, including changes to the quarantine system that is causing this issue.  I know Gatekeeper cannot be seen in preferences and its disabled by default, but the changes for it is what I'm talking about.  If you want to enable Gatekeeper on 10.7.3 you have to use the command line, but it is there.

  • 53. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    etresoft Level 7 Level 7 (24,270 points)

    doh1231 wrote:

     

    First, don't push your preferences on other people like its some type of right or wrong.  I've done quick editing of simple scripts in TextEdit for many years and its never been a problem.... its a text editor after all.

     

    TextEdit is a rich text editor that is using the NSDocument system. That is not appropriate for a script text editor. It has too much overhead. The way it saves files is not appropriate for scripting because it will assign extended attributes and arbitrarily reset permission.

     

    And yes Gatekeeper is on 10.7.3, including changes to the quarantine system that is causing this issue.  I know Gatekeeper cannot be seen in preferences and its disabled by default, but the changes for it is what I'm talking about.  If you want to enable Gatekeeper on 10.7.3 you have to use the command line, but it is there.

     

    That's all well and good, but nobody else has these problems with a true text editor. I don't even have these problems using TextEdit. If you start hacking around on new command line scripts that aren't done yet, all bets are off.

  • 54. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    Michael Wineke Level 1 Level 1 (5 points)

    I generally use the tool that is handy and simplest to use. I'm not always in Terminal (thankfully) and I have often used TextEdit to create/edit scripts. It works for me, but I also recognise the features of TextWrangler and use it as well. I was somewhat disappointed when it went to the Apple store and the download from there broke authenticated saves, so I went back to Text Edit for a while.  The current version of TextWrangler works well though.

     

    I'm not sure what the point of the whole "do this. don't do that." thing is here. Use the tool that works for you. If it fails, try a different tool.

     

    By the way, vi/vim are a pain if you just want to write simple scripts. I recognize the additional features as potentially awesome (if you can find how to use them) but for simple scripting it really is over kill. Time would tell, naturally, whether commiting to vi/vim would pay off for every/any individual scripter.

     

    There is another command line text editing tool available that is a bit friendlier and way simpler. nano. Give it a try if you haven't. You may find it is the gateway drug that pushes your to vi/vim.

  • 55. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    DervMan Level 1 Level 1 (0 points)

    Me too! Been using a backup script that (I created using TextEdit) rsyncs to my NAS for about a year but it suddenly stopped worked a few weeks back. All I did to 'fix' was open the script in TextWrangler and saved it!?!? The script is now working again.

     

    Thanks for the suggestions.

  • 56. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    anticro Level 1 Level 1 (0 points)

    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>

     

    Moderators should delete alle the spam in here.

     


  • 57. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    Michael Wineke Level 1 Level 1 (5 points)

    What you have provided was already pointed up by Frank Caggiano, and is a solution for 1 file (and arguably, a group of files) but you offer nothing in regard to preventing it in the first place, and you managed to insult everyone who HAS offered a solution to the problem occuring in the firt place.

     

    Pluses and minuses are nearly equal. Maybe YOU could post without the attitude?

  • 58. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    Michael_Sedlaczek Level 1 Level 1 (0 points)

    anthon9969 wrote:

     

    To fix it i had to go to the TextEdit file that I saved as hello.sh and right click, select Get Info and go to select Open with drop down menu and choose and select Open with: TextEdit.

     

    This fixed it for me.

  • 59. Re: bad interpreter: Operation not permitted on Lion 10.7.3
    anthon9969 Level 1 Level 1 (0 points)

    I'm glad it worked Michael and many thanks for replying to mention the solution worked. Speak soon and happy coding!