首页 > 其他 > 详细

unix 初始化脚本

时间:2015-07-02 19:02:32      阅读:114      评论:0      收藏:0      [点我收藏+]

unix系统中, 常用的初始化脚本有两个:.bashrc.bash_profile,比较容易混淆。

这两个脚本的主要区别在于,触发执行的条件不一样:

  • .bash_profile 使用用户名、密码登录成功之后,会被触发执行
  • .bashrc 打开新的窗口,比如 ubuntu terminal中输入 ctrl + shift + t,会打开新窗口,此时执行 .bashrc 脚本

一般来说,为了防止 .bash_profile 和 .bashrc 两个脚本的内容有重合,可以在 .bash_profile 中加入以下内容:

if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi

unix 初始化脚本

原文:http://www.cnblogs.com/cbffr/p/4616707.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!