https://github.com/10sr/dotfiles
設定を書く場所を集約したい
例えば、 .profile に何かを書いたとして、その後 .bash_profile が生成された場合、 bash 起動時に .profile は読まれなくなってしまう、みたいな。
.bashrc を .bash_profile から読むか .profile から読むか?
.profile: ログイン設定.bash_profile: bash 固有のログイン設定.profileを読むべき- ログイン時には
.bash_profileが読まれ、.bashrcは読まれない.bashrc_profileは explicit に.bashrcを読むべき
.shrc: 対話シェル用の設定.bashrc: bash 用の対話シェル設定.shrcを読むべき
$HOME/{.bash_profile,.zprofile} <= login with bash/zsh
| |
`---$HOME/.profile <= login with sh
| |
`---|--$HOME/.{ba,z}shrc <= bash, zsh
| |
`--`--$HOME/.shrc <= sh (by EnvVal ENV)
* .profile should load .shrc unless bash nor zsh is working
-
Login with sh
- .profile
- .shrc
-
Login with bash
- .bash_profile
- .profile
- .bashrc (from .bash_profile)
- .shrc
-
Non-login with bash
- .bashrc
- .shrc
-
.profile
- General setups for login
- 環境変数など
-
.bash_profile
- bash-specific setups for login
- なんだろう? bash 固有で使いたい環境変数とか
. ~/.profile || true
. ~/.bashrc || true
-
.shrc
- General setups for interactive shell
- よくやるやつ。関数とか alias とか
-
.bashrc
- bash-specific setups for interactive shell
- bash 固有の alias とか補完とか
. ~/.shrc || true
bash を使ってる時、
.bash_profileに. ~/.profile.bash_profileに. ~/.bashrc.bashrcに. ~/.shrc