I\'m trying to run this script on Mac OS 10.7 (Lion) and I\'m getting the error:
$ bbcolors
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Op
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted
Does /usr/bin/env
exist? Can you run it? Run by itself it should dump your environment variables to stdout.
You can safely replace:
#!/usr/bin/env perl
With the full path to your perl
binary of choice, e.g:
#!/usr/bin/perl
pilcrow's answer is correct, however I draw your attention to the fact that if you are working with a disk image, the problem can be very confusing, as the com.apple.quarantine attribute seems to be inherited from the disk image file to the files inside (thanks to febeling at Apple dev forums for noticing that!).
To solve the problem, you have to remove the quarantine attribute from the disk image:
xattr -d com.apple.quarantine /path/to/disk/image
and then eject and remount the disk image. Then your files will be clean again.
I had resolved this issue.Open the command file with TextEdit then save it.
More Info:Resolved Operation not permitted
Did you happen to open/save the file in TextEdit?
That can introduce filesystem metadata (quarantine attribute) leading to the symptom you describe.
Try:
xattr -l /usr/local/bin/bbcolors
and
xattr -d com.apple.quarantine /usr/local/bin/bbcolors
if you see the quarantine attribute.