Mac OS:/ usr / bin / env:bad interpreter:操作不允许 [英] Mac OS: /usr/bin/env: bad interpreter: Operation not permitted
问题描述
我试图在Mac OS 10.7(Lion)上运行这个脚本,我收到错误:
$ bbcolors
-bash:/ usr / local / bin / bbcolors:/ usr / bin / env:bad interpreter:不允许操作
我已经在我的其他Mac上成功运行了这个脚本。只是这个脚本从大胆火球下载并未修改。
我发现这个人有一个非常相似的问题,但接受的答案文件系统在安装时有一个'noexe'选项。我确实对我来说不是这样,因为我刚刚在/ usr / local / bin /中找到它,其他东西在那里工作正常(它也不会从其他地方运行,或者像其他用户包括root) 。
$哪些bbcolors
/ usr / local / bin / bbcolors
$ ls -l / usr / local / bin / bbcolors
-rwxr-xr-x @ 1 nick的员工9751 3月30日19:09 / usr / local / bin / bbcolors
这是一个Perl脚本不是一个编译的二进制文件,不是那么重要。以下是一些额外的信息:
$ cat / usr / local / bin / bbcolors | head -n 1
pre>
#!/ usr / bin / env perl
$ which perl
/ usr / bin / perl
$ env | grep PATH
PATH = / usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / bin:/ usr / X11 / bin
解决方案您是否碰巧在TextEdit中打开/保存文件?
可以引入文件系统元数据(隔离属性)导致您描述的症状。
尝试:
xattr -l / usr / local / bin / bbcolors
$ b和
xattr -d com.apple.quarantine / usr / local / bin / bbcolors
如果您看到隔离属性。
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: Operation not permitted
I've successfully run this script on other Macs of mine. It's just this script downloaded and unmodified from Daring Fireball.
I found this person with a very similar problem but the accepted answer was that the filesystem had a 'noexe' option on mount. I'm pretty sure that's not the case for me because I've just got it in /usr/local/bin/ and other stuff in there works fine (it also doesn't run from other places or as other users including root).
$ which bbcolors /usr/local/bin/bbcolors $ ls -l /usr/local/bin/bbcolors -rwxr-xr-x@ 1 nick staff 9751 Mar 30 19:09 /usr/local/bin/bbcolors
It's a Perl script not a compiled binary, not that that should matter. Here's some extra info for what it's worth:
$ cat /usr/local/bin/bbcolors |head -n 1 #!/usr/bin/env perl $ which perl /usr/bin/perl $ env | grep PATH PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
解决方案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.
这篇关于Mac OS:/ usr / bin / env:bad interpreter:操作不允许的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!