为什么我必须继续使用`source〜/.profile`来进行设置? [英] Why do I have to keep using `source ~/.profile` to get settings in place?

查看:106
本文介绍了为什么我必须继续使用`source〜/.profile`来进行设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个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.

看看应该.主目录中的bashrc是否自动加载?

这篇关于为什么我必须继续使用`source〜/.profile`来进行设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆