シェルの初期化を行うためのスクリプトを整理したものです。
元ネタは http://www.linux.or.jp/JF/JFdocs/Path-6.html です。*1
| 実行 順序 | Shell Script | scriptが実行されるshellの形態 | 備考 | ||||
| login | non- login | interactive | non- interactive | rsh | |||
| 1 | /etc/profile | ○ | × | − | − | × | |
| 2 | ~/.profile | ○ | ○ | ○ | ○ | ○ | /bin/shが/bin/bashのシンボリックリンクでもこちらが実行される |
| 凡例 [○:実行される ×:実行されない −:関係なし] | |||||||
| 実行 順序 | Shell Script | scriptが実行されるshellの形態 | 備考 | ||||
| login | non- login | interactive | non- interactive | rsh | |||
| 1 | /etc/profile | ○ | × | − | − | × | |
| 2* | ~/.bash_profile | ○ | ○ | ○ | ○ | ○ | |
| 2* | ~/.bash_login | × | ○ | − | − | − | ~/bash_profileがある時実行されない |
| 凡例 [○:実行される ×:実行されない −:関係なし] | |||||||
結局 ~/.bash_profile の中から ~/.profile を呼ぶのが無難ですかなぁ・・・
| 実行 順序 | Shell Script | scriptが実行されるshellの形態 | 備考 | ||||
| login | non- login | interactive | non- interactive | rsh | |||
| 1 | /etc/csh.cshrc | − | − | × | ○ | − | |
| 2 | /etc/csh.login | ○ | × | − | − | × | 主にpathをセットするのに使われる |
| 3* | ~/.tcshrc | − | − | × | ○ | − | |
| 3* | ~/.cshrc | − | − | × | ○ | − | ~/.tcshrcがある時実行されない |
| 4 | ~/.history | ○ | ○ | ○ | ○ | ○ | |
| 5 | ~/.login | ○ | × | − | − | × | 主にpathをセットするのに使われる |
| 6 | ~/.cshdirs | ○ | ○ | ○ | ○ | ○ | |
| 凡例 [○:実行される ×:実行されない −:関係なし] | |||||||