当前位置: 技术问答>linux和unix
关于hp-unix 9000 path的问题
来源: 互联网 发布时间:2016-02-12
本文导语: unix 中查看path有没有什么命令???只能去看 .profile吗? 另外,如果我用root登录,/etc下有profile 和 PATH中都有path的路径,怎么回事? 我的把gcc4.2.1安装在/app/gcc-4.2.1中,这个path如何加,是改PATH还是改profile PATH的...
unix 中查看path有没有什么命令???只能去看 .profile吗?
另外,如果我用root登录,/etc下有profile 和 PATH中都有path的路径,怎么回事?
我的把gcc4.2.1安装在/app/gcc-4.2.1中,这个path如何加,是改PATH还是改profile
PATH的内容如下:
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/fc/bin:/opt/fcms/bin:/opt/nettladm/bin:/opt/upgrade/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pd/bin:/opt/graphics/phigs/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/hparray/bin:/opt/perf/bin:/opt/OV/bin/OpC
profile中有关path的内容如下:
# Modify the variables through /etc/PATH and /etc/MANPATH
PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin
MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man
# Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).
if [ ! -d /usr/sbin ]
then
PATH=$PATH:/sbin
else if [ -r /etc/PATH ]
then
# Insure that $PATH includes /usr/bin . If /usr/bin is
# present in /etc/PATH then $PATH is set to the contents
# of /etc/PATH. Otherwise, add the contents of /etc/PATH
# to the end of the default $PATH definition above.
grep -q -e "^/usr/bin$" -e "^/usr/bin:" -e ":/usr/bin:"
-e ":/usr/bin$" /etc/PATH
if [ $? -eq 0 ]
then
PATH=`cat /etc/PATH`
else
PATH=$PATH:`cat /etc/PATH`
fi
fi
fi
export PATH
另外,如果我用root登录,/etc下有profile 和 PATH中都有path的路径,怎么回事?
我的把gcc4.2.1安装在/app/gcc-4.2.1中,这个path如何加,是改PATH还是改profile
PATH的内容如下:
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/fc/bin:/opt/fcms/bin:/opt/nettladm/bin:/opt/upgrade/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/pd/bin:/opt/graphics/phigs/bin:/opt/resmon/bin:/usr/sbin/diag/contrib:/opt/hparray/bin:/opt/perf/bin:/opt/OV/bin/OpC
profile中有关path的内容如下:
# Modify the variables through /etc/PATH and /etc/MANPATH
PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin
MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man
# Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).
if [ ! -d /usr/sbin ]
then
PATH=$PATH:/sbin
else if [ -r /etc/PATH ]
then
# Insure that $PATH includes /usr/bin . If /usr/bin is
# present in /etc/PATH then $PATH is set to the contents
# of /etc/PATH. Otherwise, add the contents of /etc/PATH
# to the end of the default $PATH definition above.
grep -q -e "^/usr/bin$" -e "^/usr/bin:" -e ":/usr/bin:"
-e ":/usr/bin$" /etc/PATH
if [ $? -eq 0 ]
then
PATH=`cat /etc/PATH`
else
PATH=$PATH:`cat /etc/PATH`
fi
fi
fi
export PATH
|
"unix 中查看path有没有什么命令???只能去看 .profile吗? "
echo $PATH
"我的把gcc4.2.1安装在/app/gcc-4.2.1中,这个path如何加,是改PATH还是改profile"
echo "export PATH=$PATH:/app/gcc-4.2.1" >> /etc/profile
echo $PATH
"我的把gcc4.2.1安装在/app/gcc-4.2.1中,这个path如何加,是改PATH还是改profile"
echo "export PATH=$PATH:/app/gcc-4.2.1" >> /etc/profile