Unix PATH覆盖命令 [英] Unix PATH override commands
本文介绍了Unix PATH覆盖命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PATH =/ usr / bin ... /root/.rbenv/shims
我在 / usr / bin
和 /root/.rbenv/shims
中有可执行文件(ruby)。如何在 /root/.rbenv/shims
中调用ruby?
解决方案在
PATH
中将 /root/.rbenv/shims
首先 :export PATH = / root / .rbenv / SHIMS:$ PATH
/ pre>
(在运行此命令之前,您必须确保
PATH
已存在 - 如果不存在,它将当前的工作目录添加到您的PATH
以及中,这几乎总是一个错误。)Let's say my
PATH="/usr/bin ... /root/.rbenv/shims"
I have an executable (ruby) in
/usr/bin
and/root/.rbenv/shims
. How would I make the ruby in/root/.rbenv/shims
be called?解决方案Put
/root/.rbenv/shims
first in yourPATH
:export PATH=/root/.rbenv/SHIMS:$PATH
(Before running this command, you must be sure
PATH
already exists -- if it doesn't, it adds the current working directory to yourPATH
as well, which is almost always a mistake.)这篇关于Unix PATH覆盖命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文