为什么我必须继续使用`source〜/.profile`来进行设置? [英] Why do I have to keep using `source ~/.profile` to get settings in place?
问题描述
我有几个bash脚本,我想确保它们默认运行,并且当前将它们存储在Mac上的~/.profile
中.那是存放它们的错误地方吗?我听说过其他人并尝试过(例如~/.bashrc
,~/.bash_profile
等),但是它们似乎没有用.
I have a couple of bash scripts that I want to make sure runs by default and I'm currently storing them in ~/.profile
on my mac. Is that the wrong place to be storing them? I've heard of others and tried them (like ~/.bashrc
, ~/.bash_profile
, etc), but they don't seem to be working.
所有这些之间有什么区别?我应该放置脚本以便在运行时进行配置,而不必每次打开终端时都调用$ source ~/.profile
?
What is the difference between all of these and which one do I put the scripts in so that it configures on runtime and I don't have to call $ source ~/.profile
every time I open the terminal?
推荐答案
+-----------------+
| |
interactive shell -->| ~/.bashrc |
| |
+-----------------+
interactive shell
将自动获取~/.bashrc
.
这篇关于为什么我必须继续使用`source〜/.profile`来进行设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!