use*_*241 14 bash fedora edit path
目前我正在尝试将ns-2的路径添加到我的.bashrc文件中,我已经安装了ns-allinone-2.34,但命令ns给出了结果:在进入shell时找不到命令.
这是我的.bashrc文件目前的样子,我使用gedit编辑它:
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export PATH=/home/michael/ns-allinone-2.34/bin/ns:/home/michael/ns-allinone-2.34/bin/nam:$PATH
Run Code Online (Sandbox Code Playgroud)
有人可以解释为什么这不起作用或可能的解决方案是什么?我正在使用fedora 17.
use*_*432 41
此外,如果您导出这样的路径,您也希望保留旧的PATH,因此也包括它.
export PATH=$PATH:/home/michael/ns-allinone-2.34/bin/
Run Code Online (Sandbox Code Playgroud)
Bri*_*new 10
本PATH
应包含目录的二进制文件,而不是二进制文件本身.
例如,在上面:
export PATH=/home/michael/ns-allinone-2.34/bin/ns:..
Run Code Online (Sandbox Code Playgroud)
应该是:
export PATH=/home/michael/ns-allinone-2.34/bin:...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
79235 次 |
最近记录: |