[英]Error Message on eval $PATH in Fish
Running eval $PATH produces this message: 运行eval $ PATH会产生以下消息:
The file '/usr/local/var/rbenv/shims' is not executable by this user
- (line 1): begin; /usr/local/var/rbenv/shims /usr/local/bin /usr/local/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin
^
from sourcing file -
called on line 60 of file /usr/local/Cellar/fish/HEAD/share/fish/functions/eval.fish
in function 'eval'
called on standard input
This doesn't seem to be causing any problems with rbenv, just curious as to what is causing this error message and if anyone knows how to fix it. 这似乎并没有导致rbenv出现任何问题,只是对导致此错误消息的原因以及是否有人知道如何解决它感到好奇。
This is all on OS X El Capitan with rbenv installed by homebrew. 这一切都在OS X El Capitan上,并且由Homebrew安装了rbenv。
PS: Could this have something to do with the fact that '/usr/local/var/rbenv/shims' is a directory, not a file? PS:这可能与“ / usr / local / var / rbenv / shims”是目录而不是文件有关吗? If so, why does fish think it is a file?
如果是这样,鱼为什么会认为它是文件?
eval $$PATH
doesn't do what you think it does. eval $$PATH
不会执行您认为的操作。 eval
runs its arguments through an an extra cycle of parsing (quote and escape processing, etc) then tries to run the result as a command. eval
通过一个额外的解析周期(引号和转义处理等)运行其参数,然后尝试将结果作为命令运行。 Your PATH
is not going to evaluate to a valid command -- it's a list of directories where the shell looks for commands. 您的
PATH
不会计算出有效的命令-它是外壳程序在其中查找命令的目录列表。 Normally, I'd expect it to treat the entire bunch of directories as a single command and get an error because it's not a valid command name. 通常,我希望它会将整个目录视为一个命令,并会收到错误消息,因为它不是有效的命令名称。 In this case, it seems to be treating each directory in your
PATH
as a separate word (and hence treating the first as a command and the rest as arguments to that command). 在这种情况下,似乎将
PATH
中的每个目录都视为一个单独的单词(因此将第一个目录作为命令,其余的作为该命令的参数)。 Did you set IFS
to ":" by any chance? 您是否将
IFS
设置为“:”?
Anyway, the solution is simple: don't use eval $PATH
. 无论如何,解决方案很简单:不要使用
eval $PATH
。 I'm not sure what you wanted it to do, but whatever that was you need to find a different way to do it. 我不确定您希望它做什么,但是无论您需要什么,都需要找到一种不同的方式来做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.