发新话题
打印

.bash_profile 与 .bashrc 的区别

.bash_profile 与 .bashrc 的区别

.bash_profile is read and executed only by the login shell.
If you start up a new shell (a subshell) by typing bash on the command line, it will attempt to read commands from the file .bashrc.

今天才知道两个文件不是不同的。      

TOP

不过好像很少用了
不少发行版里默认这个文件都没有被创建      
面包会有的 女人也会有的
_______________________

TOP

补充一下
复制内容到剪贴板
代码:
[0 No.514 huanlf@huan ~]$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
      
面包会有的 女人也会有的
_______________________

TOP

引用:
原帖由 li-jiahuan 于 2007-7-3 13:02 发表
不过好像很少用了
不少发行版里默认这个文件都没有被创建
‘默认没有被创建’不能说明‘很少用了’,俺的 bashrc 现在有 1600 行之多,还在不断的维护、增长中       
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

可以看看 bash 的 man page 中的 INVOCATION 章节      
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

引用:
原帖由 dearvoid 于 2007-7-3 18:32 发表

‘默认没有被创建’不能说明‘很少用了’,俺的 bashrc 现在有 1600 行之多,还在不断的维护、增长中
呵,我指的是 .bash_profile

另外这些文件默认是否被"创建"
这种说法也不是很准确
这些默认的文件是在运行"useradd"时从 /etc/skel/下拷贝到$HOME的      
面包会有的 女人也会有的
_______________________

TOP

.bashrc 是csh 启动时读出的配置文件      

TOP

引用:
原帖由 Ai.Game 于 2007-7-11 23:48 发表
.bashrc 是csh 启动时读出的配置文件
i'm sorry to hear that       
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

发新话题