Mac OS:/ usr / bin / env:bad interpreter:操作不允许 [英] Mac OS: /usr/bin/env: bad interpreter: Operation not permitted

查看:2019
本文介绍了Mac OS:/ usr / bin / env:bad interpreter:操作不允许的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在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 
#!/ 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
pre>

解决方案

您是否碰巧在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆