当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 如何设置这样的环境变量
帖子发表于 : 2012-05-10 22:37 

注册: 2008-04-12 12:44
帖子: 980
送出感谢: 1
接收感谢: 2
我的系统,
sudo find / -name 'pppoeconf'
/usr/sbin/pppoeconf
/usr/share/menu/pppoeconf
/usr/share/doc/pppoeconf

我输入pppoeconf,提示找不到命令。

于是我打开,sudo gedit /etc/profile,显示

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "$PS1" ]; then
if [ "$BASH" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi

我使用sudo cp /usr/sbin/pppoeconf /usr/bin/pppoeconf
然后使用pppoeconf,可以执行了,

现在我想知道,可否直接编辑 /etc/profile,达到同样的效果,请问,如何编辑这个文件?


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 如何设置这样的环境变量
帖子发表于 : 2012-05-10 22:41 
头像

注册: 2007-02-02 18:14
帖子: 30702
系统: debian sid
送出感谢: 1
接收感谢: 34
你把那两个PATH弄成一样就可以了


_________________
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 如何设置这样的环境变量
帖子发表于 : 2012-05-11 6:12 

注册: 2008-04-12 12:44
帖子: 980
送出感谢: 1
接收感谢: 2
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

这段修改成
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
export PATH
这样做,会有什么不良结果?


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译