#Title: Linux/Centos5.5 Error: "-bash: telnet: command not found"
#Author: xueyan.lu
#History: 2011-11-09
#CopyLeft: NSN
#Notes: Two conceptions referred: Control PC--- PC do telnet command; Tshark PC---PC be telnetted.
1. Phenomenon:
1.1 (If you do not use Robot, plz ignore sector 1.1)After running "start tshark", "stop tshark" and "copy log to control PC" in Robot script, there is not any error. But tshark log is 0KB in Control PC.
1.2 In Control PC, telnet Tshark PC, and input "tshark", error prints: -bash: telnet: command not found;
In Tshark PC, command tshark can work well.
1.3 $which tshark
$/usr/local/bin
1.4 In Control PC, echo $PATH, which includes /usr/local/bin
In Tshark PC, echo $PATH, which excludes /usr/local/bin
2. Solution:
2.1$ vi /etc/profile, and append /usr/local/bin to PATH.
$ source /etc/profile
3. Analysis:
>直接用export命令:
>修改profile文件(应用到所有帐户):
References:
http://serverfault.com/questions/175041/bash-telnet-command-not-found-error
http://www.cnblogs.com/amboyna/archive/2008/03/08/1096024.html
#Author: xueyan.lu
#History: 2011-11-09
#CopyLeft: NSN
#Notes: Two conceptions referred: Control PC--- PC do telnet command; Tshark PC---PC be telnetted.
1. Phenomenon:
2. Solution:
3. Analysis:
>直接用export命令:
查看是否已经设好,可用命令export查看:
#export
>修改profile文件(应用到所有帐户):
#vi /etc/profile
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin"
>修改.bashrc文件(仅应用到该帐户):
# vi /root/.bashrc
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin"
References:http://serverfault.com/questions/175041/bash-telnet-command-not-found-error
http://www.cnblogs.com/amboyna/archive/2008/03/08/1096024.html
本文解决了一个在 CentOS 5.5 中使用 telnet 命令时出现的“命令未找到”错误。通过调整环境变量 PATH,将 /usr/local/bin 添加进去解决了这一问题。

6625

被折叠的 条评论
为什么被折叠?



