免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1412 | 回复: 3
打印 上一主题 下一主题

在登录后的bash并不执行~/.bashrc ,为什么? (Gentoo) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-09 15:55 |只看该作者 |倒序浏览
刚登录系统的那个bash不去执行~/.bashrc 因为在其中定义的变量echo不到。
必须source一下,或者再起一个bash。这是为什么呢?

论坛徽章:
0
2 [报告]
发表于 2006-07-09 16:03 |只看该作者
原帖由 wsw1wsw2 于 2006-7-9 15:55 发表
刚登录系统的那个bash不去执行~/.bashrc 因为在其中定义的变量echo不到。
必须source一下,或者再起一个bash。这是为什么呢?


bash 于 login shell 本来就不会读取 .bashrc。

login shell mode 只会读取 ~/.bash_profile , ~/.bash_login , ~/.profile 里面其中一个而已。

== 

论坛徽章:
0
3 [报告]
发表于 2006-07-09 16:06 |只看该作者
刚刚man 到了,谢谢楼上的。

看来以后要多man,少CU了!

论坛徽章:
0
4 [报告]
发表于 2006-07-09 16:29 |只看该作者

  1. [0 No.1999 huan@deb ~]$ cat .bash_profile
  2. # ~/.bash_profile: executed by bash(1) for login shells.
  3. # see /usr/share/doc/bash/examples/startup-files for examples.
  4. # the files are located in the bash-doc package.

  5. # the default umask is set in /etc/login.defs
  6. #umask 022

  7. # ****************** 注意这里 ********************
  8. # include .bashrc if it exists
  9. if [ -f ~/.bashrc ]; then
  10.     . ~/.bashrc
  11. fi

  12. # the rest of this file is commented out.

复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP